Skip to content

Commit 6de403c

Browse files
committed
test(e2e): Update tests to handle untrusted password on sign-in
1 parent d2b971d commit 6de403c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

integration/tests/session-tasks-sign-in-reset-password.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { test } from '@playwright/test';
1+
import { expect, test } from '@playwright/test';
22

33
import { hash } from '../models/helpers';
44
import { appConfigs } from '../presets';
@@ -31,6 +31,10 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
3131
await u.page.getByRole('textbox', { name: 'code' }).click();
3232
await u.page.keyboard.type('424242', { delay: 100 });
3333

34+
await expect(u.page.getByText(/password compromised/i)).toBeVisible();
35+
36+
await u.po.signIn.getAltMethodsEmailCodeButton().click();
37+
3438
// Redirects back to tasks when accessing protected route by `auth.protect`
3539
await u.page.goToRelative('/page-protected');
3640

@@ -75,6 +79,10 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
7579

7680
await u.page.getByRole('textbox', { name: 'code' }).fill('424242');
7781

82+
await expect(u.page.getByText(/password compromised/i)).toBeVisible();
83+
await u.po.signIn.getAltMethodsEmailCodeButton().click();
84+
await u.page.getByRole('textbox', { name: 'code' }).fill('424242');
85+
7886
await u.po.expect.toBeSignedIn();
7987

8088
// Redirects back to tasks when accessing protected route by `auth.protect`

0 commit comments

Comments
 (0)