Skip to content

Commit

Permalink
fix: signIn SignOut test
Browse files Browse the repository at this point in the history
  • Loading branch information
akshbhu committed Nov 9, 2021
1 parent f3e494f commit 77e60cf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
2 changes: 0 additions & 2 deletions packages/amplify-e2e-core/src/categories/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ export function updateAuthSignInSignOutUrl(cwd: string, settings: any): Promise<
.sendCarriageReturn()
.wait('Do you want to add redirect signout URIs?')
.sendConfirmNo()
.delay(10000)
.sendEof()
.run((err: Error) => {
if (!err) {
Expand Down Expand Up @@ -585,7 +584,6 @@ export function addAuthWithSignInSignOutUrl(cwd: string, settings: any): Promise
.sendCarriageReturn()
.wait('Select the social providers you want to configure for your user pool:')
.sendCarriageReturn()
.delay(300000)
.sendEof()
.run((err: Error) => {
if (!err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
deleteProject,
deleteProjectDir,
getAwsAndroidConfig,
getBackendAmplifyMeta,
getLambdaFunction,
getProjectMeta,
getUserPool,
Expand Down Expand Up @@ -122,26 +123,25 @@ describe('amplify auth migration', () => {
expect(meta.Auth.Default.authenticationFlowType).toEqual('USER_SRP_AUTH');
});

// it.only('...should edit signin url on update', async () => {
// let settings = {
// signinUrl: 'http://localhost:3001/',
// signoutUrl: 'http://localhost:3002/',
// updatesigninUrl: 'http://localhost:3003/',
// updatesignoutUrl: 'http://localhost:3004/',
// };
// await initAndroidProjectWithProfile(projRoot, defaultSettings);
// await addAuthWithSignInSignOutUrl(projRoot, settings);
// const amplifyMeta = getProjectMeta(projRoot);
// const authResourceName = Object.keys(amplifyMeta.auth).filter(resourceName => amplifyMeta.auth[resourceName].service === 'Cognito')[0];
// // update and push with codebase
// const overridesObj: $TSAny = {
// resourceName: authResourceName,
// category: 'auth',
// service: 'cognito',
// };
// await updateAuthSignInSignOutUrl(projRoot, { testingWithLatestCodebase: true, overrides: overridesObj });
// await amplifyPushAuth(projRoot,true);
// });
it('...should edit signin url on update', async () => {
let settings = {
signinUrl: 'http://localhost:3001/',
signoutUrl: 'http://localhost:3002/',
updatesigninUrl: 'http://localhost:3003/',
updatesignoutUrl: 'http://localhost:3004/',
};
await initAndroidProjectWithProfile(projRoot, defaultSettings);
await addAuthWithSignInSignOutUrl(projRoot, settings);
const amplifyMeta = getBackendAmplifyMeta(projRoot);
const authResourceName = Object.keys(amplifyMeta.auth).filter(resourceName => amplifyMeta.auth[resourceName].service === 'Cognito')[0];
// update and push with codebase
const overridesObj: $TSAny = {
resourceName: authResourceName,
category: 'auth',
service: 'cognito',
};
await updateAuthSignInSignOutUrl(projRoot, { testingWithLatestCodebase: true, overrides: overridesObj });
});

it('updates existing auth resource', async () => {
const updateAuthRequest: UpdateAuthRequest = {
Expand Down

0 comments on commit 77e60cf

Please sign in to comment.