silverwolf-x/project / test /e2e /app-dir /app-prefetch-static /app-prefetch-static.test.ts
silverwolf-x's picture
download
raw
1.02 kB
import { nextTestSetup } from 'e2e-utils'
import { waitFor } from 'next-test-utils'
describe('app-prefetch-static', () => {
const { next, isNextDev } = nextTestSetup({
files: __dirname,
})
if (isNextDev) {
it('should skip next dev', () => {})
return
}
it('should correctly navigate between static & dynamic pages', async () => {
const browser = await next.browser('/')
// Ensure the page is prefetched
await waitFor(1000)
await browser.elementByCss('#static-prefetch').click()
expect(await browser.elementByCss('#static-prefetch-page').text()).toBe(
'Hello from Static Prefetch Page'
)
await browser.elementByCss('#dynamic-prefetch').click()
expect(await browser.elementByCss('#dynamic-prefetch-page').text()).toBe(
'Hello from Dynamic Prefetch Page'
)
await browser.elementByCss('#static-prefetch').click()
expect(await browser.elementByCss('#static-prefetch-page').text()).toBe(
'Hello from Static Prefetch Page'
)
})
})

Xet Storage Details

Size:
1.02 kB
·
Xet hash:
0059b2adfd2f89ed4ffb46393d4d1c448e74bc7ab6e3a80a09b09e84edba3cec

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.