Unverified Commit b400f8ec authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[test] Use new Redbox matchers in app/ dynamic-error (#76744)

parent d4919b31
...@@ -29,11 +29,21 @@ describe('dynamic = "error" in devmode', () => { ...@@ -29,11 +29,21 @@ describe('dynamic = "error" in devmode', () => {
]), ]),
'/server' '/server'
) )
const { session } = sandbox const { browser } = sandbox
await session.assertHasRedbox()
const description = await session.getRedboxDescription() await expect(browser).toDisplayRedbox(`
expect(description).toMatchInlineSnapshot( {
`"Error: Route /server with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering"` "count": 1,
) "description": "Error: Route /server with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering",
"environmentLabel": "Server",
"label": "Unhandled Runtime Error",
"source": "app/server/page.js (4:16) @ Page
> 4 | await cookies()
| ^",
"stack": [
"Page app/server/page.js (4:16)",
],
}
`)
}) })
}) })
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