Files
Jiachi LiuandGitHub 8f060ea25a [test] improve segment explorer tests snapshot (#81616)
Format line format: `<segment> [<files,>]`

This will help visualize the rendered segment explorer panel easier by checking the snapshot. e.g.

```
app/ [layout.tsx]
parallel-routes/ [layout.tsx, page.tsx]
@bar/ [layout.tsx, page.tsx]
@foo/ [layout.tsx, page.tsx]
```
2025-07-14 17:45:48 +02:00

23 lines
711 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
import { getSegmentExplorerContent } from 'next-test-utils'
describe('segment-explorer - globals', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('should show global-error segment', async () => {
const browser = await next.browser('/runtime-error')
expect(await getSegmentExplorerContent(browser)).toMatchInlineSnapshot(
`"app/ [global-error.tsx]"`
)
})
it('should display parallel routes default page when present', async () => {
const browser = await next.browser('/404-not-found')
expect(await getSegmentExplorerContent(browser)).toMatchInlineSnapshot(
`"app/ [global-not-found.tsx]"`
)
})
})