Skip to content

Commit 5fa0dd7

Browse files
authored
Fix flaky onboarding test (#761)
1 parent 25a2bee commit 5fa0dd7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/e2e/onboarding.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ test('completes onboarding after GitHub OAuth given valid user details', async (
156156
await page.getByRole('button', { name: /signup with github/i }).click()
157157

158158
await expect(page).toHaveURL(/\/onboarding\/github/)
159-
expect(
159+
await expect(
160160
page.getByText(new RegExp(`welcome aboard ${ghUser.primaryEmail}`, 'i')),
161161
).toBeVisible()
162162

@@ -222,7 +222,7 @@ test('logs user in after GitHub OAuth if they are already registered', async ({
222222
await page.getByRole('button', { name: /signup with github/i }).click()
223223

224224
await expect(page).toHaveURL(`/`)
225-
expect(
225+
await expect(
226226
page.getByText(
227227
new RegExp(
228228
`your "${ghUser!.profile.login}" github account has been connected`,
@@ -247,7 +247,7 @@ test('shows help texts on entering invalid details on onboarding page after GitH
247247
await page.getByRole('button', { name: /signup with github/i }).click()
248248

249249
await expect(page).toHaveURL(/\/onboarding\/github/)
250-
expect(
250+
await expect(
251251
page.getByText(new RegExp(`welcome aboard ${ghUser.primaryEmail}`, 'i')),
252252
).toBeVisible()
253253

@@ -257,15 +257,15 @@ test('shows help texts on entering invalid details on onboarding page after GitH
257257
const createAccountButton = page.getByRole('button', {
258258
name: /create an account/i,
259259
})
260-
expect(createAccountButton.getByRole('status')).not.toBeVisible()
261-
expect(createAccountButton.getByText('error')).not.toBeAttached()
260+
await expect(createAccountButton.getByRole('status')).not.toBeVisible()
261+
await expect(createAccountButton.getByText('error')).not.toBeAttached()
262262

263263
// invalid chars in username
264264
await usernameInput.fill('U$er_name') // $ is invalid char, see app/utils/user-validation.ts.
265265
await createAccountButton.click()
266266

267267
await expect(createAccountButton.getByRole('status')).toBeVisible()
268-
expect(createAccountButton.getByText('error')).toBeAttached()
268+
await expect(createAccountButton.getByText('error')).toBeAttached()
269269
await expect(
270270
page.getByText(
271271
/username can only include letters, numbers, and underscores/i,

0 commit comments

Comments
 (0)