Skip to content

Commit

Permalink
add app page test case
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Mar 22, 2023
1 parent 1d3dbe8 commit 8238fb2
Showing 1 changed file with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function runTests(
)

it(
'should show error overlay',
'should show error overlay for a broken page',
async () => {
await harness.waitForLoaded(iframe)
const errorOverlay = await harness.waitForErrorOverlay(iframe)
Expand All @@ -56,10 +56,36 @@ function runTests(
)
expect(issues.innerHTML).toContain('Error during SSR Rendering')
expect(issues.innerHTML).toContain('Error: Broken page')
expect(issues.innerHTML).toContain('Debug info:')
expect(issues.innerHTML).toContain('input/pages/broken.tsx:2')
expect(issues.innerHTML).toContain("throw new Error('Broken page')")
},
TIMEOUT
)

// TODO: Fix this
// it(
// 'returns a 500 status code',
// async () => {
// const res = await fetch('/broken-app')
// expect(res.status).toBe(500)
// },
// TIMEOUT
// )

it(
'should show error overlay for a broken app page',
async () => {
await harness.waitForLoaded(iframe)
const errorOverlay = await harness.waitForErrorOverlay(iframe)
const issues = await harness.waitForSelector(
errorOverlay,
'#runtime-errors'
)
expect(issues.innerHTML).toContain('Error: Broken app')
// TODO: Fix this
// expect(issues.innerHTML).toContain('input/app/broken-app/page.tsx:2')
// expect(issues.innerHTML).toContain("throw new Error('Broken app')")
},
TIMEOUT
)
}

0 comments on commit 8238fb2

Please sign in to comment.