Unverified Commit 5bb25f9b authored by JJ Kasper's avatar JJ Kasper Committed by GitHub
parent 112ef611
import { nextTestSetup } from 'e2e-utils' import { nextTestSetup } from 'e2e-utils'
import { assertHasRedbox } from 'next-test-utils' import { assertHasRedbox, retry } from 'next-test-utils'
describe('DevErrorOverlay', () => { describe('DevErrorOverlay', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
...@@ -33,15 +33,17 @@ describe('DevErrorOverlay', () => { ...@@ -33,15 +33,17 @@ describe('DevErrorOverlay', () => {
await browser.elementByCss('button').click() // clicked "break on client" await browser.elementByCss('button').click() // clicked "break on client"
await browser.getByRole('button', { name: 'Mark as helpful' }).click() await browser.getByRole('button', { name: 'Mark as helpful' }).click()
expect( await retry(async () => {
await browser expect(
.getByRole('region', { name: 'Error feedback' }) await browser
.getByRole('status') .getByRole('region', { name: 'Error feedback' })
.textContent() .getByRole('status')
).toEqual('Thanks for your feedback!') .textContent()
expect(feedbackRequests).toEqual([ ).toEqual('Thanks for your feedback!')
'/__nextjs_error_feedback?errorCode=E794&wasHelpful=true', expect(feedbackRequests).toEqual([
]) '/__nextjs_error_feedback?errorCode=E794&wasHelpful=true',
])
})
}) })
it('sends feedback when clicking not helpful button', async () => { it('sends feedback when clicking not helpful button', async () => {
...@@ -60,15 +62,17 @@ describe('DevErrorOverlay', () => { ...@@ -60,15 +62,17 @@ describe('DevErrorOverlay', () => {
await browser.elementByCss('button').click() // clicked "break on client" await browser.elementByCss('button').click() // clicked "break on client"
await browser.getByRole('button', { name: 'Mark as not helpful' }).click() await browser.getByRole('button', { name: 'Mark as not helpful' }).click()
expect( await retry(async () => {
await browser expect(
.getByRole('region', { name: 'Error feedback' }) await browser
.getByRole('status') .getByRole('region', { name: 'Error feedback' })
.textContent() .getByRole('status')
).toEqual('Thanks for your feedback!') .textContent()
expect(feedbackRequests).toEqual([ ).toEqual('Thanks for your feedback!')
'/__nextjs_error_feedback?errorCode=E794&wasHelpful=false', expect(feedbackRequests).toEqual([
]) '/__nextjs_error_feedback?errorCode=E794&wasHelpful=false',
])
})
}) })
it('loads fonts successfully', async () => { it('loads fonts successfully', async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment