Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changeset/funny-crabs-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

---
18 changes: 14 additions & 4 deletions integration/tests/session-tasks-sign-in-reset-password.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test } from '@playwright/test';
import { expect, test } from '@playwright/test';

import { hash } from '../models/helpers';
import { appConfigs } from '../presets';
Expand Down Expand Up @@ -28,6 +28,10 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
await u.po.signIn.setPassword(user.password);
await u.po.signIn.continue();

await expect(u.page.getByTestId('form-feedback-error')).toBeVisible();
await u.po.signIn.getUseAnotherMethodLink().click();
await u.po.signIn.getAltMethodsEmailCodeButton().click();

await u.page.getByRole('textbox', { name: 'code' }).click();
await u.page.keyboard.type('424242', { delay: 100 });

Expand Down Expand Up @@ -62,7 +66,8 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
await u.services.users.passwordUntrusted(createdUser.id);
const fakeOrganization = u.services.organizations.createFakeOrganization();
await u.services.organizations.createBapiOrganization({
...fakeOrganization,
name: fakeOrganization.name,
slug: fakeOrganization.slug + Date.now().toString(),
createdBy: createdUser.id,
});

Expand All @@ -73,9 +78,14 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
await u.po.signIn.setPassword(user.password);
await u.po.signIn.continue();

await u.page.getByRole('textbox', { name: 'code' }).fill('424242');
await expect(u.page.getByTestId('form-feedback-error')).toBeVisible();

await u.po.signIn.getUseAnotherMethodLink().click();

await u.po.signIn.getAltMethodsEmailCodeButton().click();

await u.po.expect.toBeSignedIn();
await u.page.getByRole('textbox', { name: 'code' }).click();
await u.page.keyboard.type('424242', { delay: 100 });

// Redirects back to tasks when accessing protected route by `auth.protect`
await u.page.goToRelative('/page-protected');
Expand Down
Loading