Skip to content

Commit cd2d5d8

Browse files
committed
fix: unit tests for oauth cancel
1 parent 0caf0d2 commit cd2d5d8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,8 @@ describe('signInWithRedirect', () => {
368368
const expectedError = new Error('OAuth flow was cancelled.');
369369
const mockOpenAuthSessionResult = {
370370
type: 'canceled',
371-
url: 'https://url.com',
372371
};
373-
mockCreateOAuthError.mockClear();
372+
374373
mockOpenAuthSession.mockResolvedValueOnce(mockOpenAuthSessionResult);
375374
mockCreateOAuthError.mockReturnValueOnce(expectedError);
376375

@@ -381,7 +380,9 @@ describe('signInWithRedirect', () => {
381380
}),
382381
).rejects.toThrow(expectedError);
383382

384-
expect(mockCreateOAuthError).toHaveBeenCalledWith('canceled');
383+
expect(mockCreateOAuthError).toHaveBeenCalledWith(
384+
mockOpenAuthSessionResult.type,
385+
);
385386
expect(mockHandleFailure).toHaveBeenCalledWith(expectedError);
386387
});
387388

0 commit comments

Comments
 (0)