Skip to content

Commit

Permalink
Add 404 assertion to e2e error-boundary (epicweb-dev#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderKoopmans authored Oct 31, 2023
1 parent d0584fe commit 7417c50
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/e2e/error-boundary.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { expect, test } from '#tests/playwright-utils.ts'

test('Test root error boundary caught', async ({ page }) => {
await page.goto('/does-not-exist')
const pageUrl = '/does-not-exist'
const res = await page.goto(pageUrl)

expect(res?.status()).toBe(404)
await expect(page.getByText(/We can't find this page/i)).toBeVisible()
// TODO: figure out how to assert the 404 status code
})

0 comments on commit 7417c50

Please sign in to comment.