Skip to content

Commit 8d8226e

Browse files
committed
test(auth): add test for signInWithRedirect
1 parent 1d6c320 commit 8d8226e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/auth/__tests__/providers/cognito/signInWithRedirect.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,16 @@ describe('signInWithRedirect', () => {
233233
mockAssertUserNotAuthenticated.mockClear();
234234
});
235235

236+
it('calls default openAuthSession if no override specified', async () => {
237+
const mockAuthSessionOpener = jest.fn();
238+
await signInWithRedirect({
239+
provider: 'Google',
240+
});
241+
242+
expect(mockOpenAuthSession).toHaveBeenCalled();
243+
expect(mockAuthSessionOpener).not.toHaveBeenCalled();
244+
});
245+
236246
it('allows to override openAuthSession if specified', async () => {
237247
const mockAuthSessionOpener = jest.fn();
238248
await signInWithRedirect({

0 commit comments

Comments
 (0)