Skip to content

Commit

Permalink
fix: not appending notification configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Samaritan1011001 committed Feb 1, 2024
1 parent b893b0c commit cb7040f
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 cb7040f

Please sign in to comment.