Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions apps/web/playwright/hash-my-url.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ test.describe("hash my url", () => {
// We wait until loading is finished
await page.waitForSelector('[data-testid="event-types"]');
await page.locator("ul[data-testid=event-types] > li a").first().click();
await expect(page.getByTestId("vertical-tab-event_setup_tab_title")).toHaveAttribute(
"aria-current",
"page"
); // fix the race condition
await expect(page.getByTestId("vertical-tab-event_setup_tab_title")).toContainText("Event Setup"); //fix the race condition
// We wait for the page to load
await page.locator(".primary-navigation >> text=Advanced").click();
// ignore if it is already checked, and click if unchecked
Expand Down
7 changes: 2 additions & 5 deletions apps/web/playwright/login.2fa.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,13 @@ test.describe("2FA Tests", async () => {
secret: secret!,
});

// FIXME: this passes even when switch is not checked, compare to test
// below which checks for data-state="checked" and works as expected
await page.waitForSelector(`[data-testid=two-factor-switch]`);
await expect(page.locator(`[data-testid=two-factor-switch]`).isChecked()).toBeTruthy();
await expect(page.getByTestId("backup-codes-download")).toBeVisible();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assertion may not be sufficient to verify 2FA is enabled. The backup codes download button is visible during setup, but doesn't confirm the switch state.


return user;
});

await test.step("Logout", async () => {
await page.goto("/auth/logout");
await users.logout();
});

await test.step("Login with 2FA enabled", async () => {
Expand Down
Loading