Skip to content

Commit

Permalink
Refactor user menu button in 2fa.test.ts and onboarding.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisblackburn committed Sep 9, 2024
1 parent 24ccba2 commit a99b745
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/2fa.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test('Users can add 2FA to their account and use it when logging in', async ({
// await expect(main).toHaveText(/You have enabled two-factor authentication./i)
await expect(main.getByRole('link', { name: /disable 2fa/i })).toBeVisible()

await page.getByRole('button', { name: `${user.name} Toggle user` }).click()
await page.getByRole('link', { name: user.name ?? user.username }).click()
await page.getByRole('button', { name: /logout/i }).click()
await expect(page).toHaveURL(`/`)

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/onboarding.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ test('onboarding with link', async ({ page, getOnboardingData }) => {
await expect(page).toHaveURL(`/dashboard`)

await page
.getByRole('button', { name: `${onboardingData.name} Toggle user` })
.getByRole('link', { name: onboardingData.name ?? onboardingData.username })
.click()

await page.getByRole('menuitem', { name: /profile/i }).click()
Expand All @@ -112,7 +112,7 @@ test('onboarding with link', async ({ page, getOnboardingData }) => {
await page.waitForTimeout(1000)

await page
.getByRole('button', { name: `${onboardingData.name} Toggle user` })
.getByRole('link', { name: onboardingData.name ?? onboardingData.username })
.click()
await page.getByRole('menuitem', { name: /logout/i }).click()
await expect(page).toHaveURL(`/`)
Expand Down

0 comments on commit a99b745

Please sign in to comment.