-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add missing auto sign-in unit tests #12484
base: main
Are you sure you want to change the base?
Conversation
autoSignIn, | ||
resetAutoSignIn, | ||
} from '../../../src/providers/cognito/apis/autoSignIn'; | ||
import * as clients from '../../../src/providers/cognito/utils/clients/CognitoIdentityProvider'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nit: this is importing a single (CognitoIdentityProvider) client, so the plural name could be misleading.
}); | ||
|
||
test('Auto sign-in should resolve to a signIn output', async () => { | ||
const signInOutput = await autoSignIn(); | ||
expect(signInOutput).toEqual(authAPITestParams.signInResult()); | ||
expect(handleUserSRPAuthflowSpy).toBeCalledTimes(1); | ||
}); | ||
|
||
test('Auto sign-in should not resolve if a different user is confirmed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is what is being tested here. It looks like we never test auto sign-in after the first user is confirmed.
Description of changes
add the following tests cases for auto sign-in:
confirmSignUp
failssignUp
should return "COMPLETE_AUTO_SIGN_IN" step whenautoSignIn
is enabled with verification link.Issue #, if available
Description of how you validated changes
yarn test
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.