Files
vercel__next.js/test/e2e/app-dir/segment-cache/no-prefetch/no-prefetch.test.ts
2026-02-10 17:56:33 -08:00

25 lines
772 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils'
describe('navigating without a prefetch', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('can show a loading boundary from the dynamic response', async () => {
const browser = await next.browser('/')
// Navigate to a dynamic page with a `loading.tsx` without a prefetch.
await browser.elementByCss('a[href="/with-loading"]').click()
// The page suspends on the client, so we should display the `loading` that we got from the dynamic response.
await retry(async () => {
expect(
await browser
.elementByCss('#loading-component', { state: 'visible' })
.text()
).toContain('Loading...')
})
})
})