-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: pull project with removed notifications (#11378)
* fix: pull project with removed notifications
- Loading branch information
1 parent
36bc08e
commit 091d1d6
Showing
8 changed files
with
234 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/amplify-e2e-tests/src/__tests__/notifications-sms-pull.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { | ||
addNotificationChannel, | ||
amplifyPull, | ||
createNewProjectDir, | ||
deleteProject, | ||
deleteProjectDir, | ||
getAppId, | ||
initJSProjectWithProfile, | ||
removeAllNotificationChannel, | ||
} from '@aws-amplify/amplify-e2e-core'; | ||
import { | ||
getShortId, | ||
} from '../import-helpers'; | ||
|
||
describe('notification category pull test', () => { | ||
const testChannel = 'SMS'; | ||
const testChannelSelection = 'SMS'; | ||
const projectPrefix = `notification${testChannel}`.substring(0, 19); | ||
const projectSettings = { | ||
name: projectPrefix, | ||
disableAmplifyAppCreation: false, | ||
}; | ||
|
||
let projectRoot: string; | ||
|
||
beforeEach(async () => { | ||
projectRoot = await createNewProjectDir(projectPrefix); | ||
}); | ||
|
||
afterEach(async () => { | ||
await deleteProject(projectRoot); | ||
deleteProjectDir(projectRoot); | ||
}); | ||
|
||
it(`should add and remove the ${testChannel} channel and pull in new directory`, async () => { | ||
await initJSProjectWithProfile(projectRoot, projectSettings); | ||
|
||
const settings = { resourceName: `${projectPrefix}${getShortId()}` }; | ||
await addNotificationChannel(projectRoot, settings, testChannelSelection); | ||
|
||
const appId = getAppId(projectRoot); | ||
expect(appId).toBeDefined(); | ||
|
||
await removeAllNotificationChannel(projectRoot); | ||
|
||
const projectRootPull = await createNewProjectDir('removed-notifications-pull'); | ||
try { | ||
await amplifyPull(projectRootPull, { override: false, emptyDir: true, appId }); | ||
} finally { | ||
deleteProjectDir(projectRootPull); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.