Skip to content

Commit

Permalink
fix(core): not appending notification configs properly (#12934)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samaritan1011001 authored Feb 1, 2024
2 parents b893b0c + cb7040f commit d7900dc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
39 changes: 39 additions & 0 deletions packages/core/__tests__/parseAWSExports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,43 @@ describe('parseAWSExports', () => {
'Invalid config parameter.'
);
});
it('should append Notification configs when both Push and InApp configs are available', () => {
const testConfig = {
aws_project_region: 'us-west-2',
aws_user_pools_id: userPoolId,
Notifications: {
Push: {
AWSPinpoint: {
appId: "appId",
region: "region"
}
},
InAppMessaging: {
AWSPinpoint: {
appId: "appId",
region: "region"
}
}
}
};

expect(parseAWSExports(testConfig)).toMatchObject(
{
Notifications: {
PushNotification: {
Pinpoint: {
appId: "appId",
region: "region"
}
},
InAppMessaging: {
Pinpoint: {
appId: "appId",
region: "region"
}
}
}
}
);
});
});
1 change: 1 addition & 0 deletions packages/core/src/parseAWSExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const parseAWSExports = (
if (Push?.AWSPinpoint) {
const { appId, region } = Push.AWSPinpoint;
amplifyConfig.Notifications = {
...amplifyConfig.Notifications,
PushNotification: {
Pinpoint: {
appId,
Expand Down

0 comments on commit d7900dc

Please sign in to comment.