mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
31 lines
922 B
TypeScript
31 lines
922 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { waitForNoRedbox } from 'next-test-utils'
|
|
|
|
describe('hmr-parallel-routes', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should update parallel routes via HMR', async () => {
|
|
const browser = await next.browser('/')
|
|
expect(await browser.elementByCss('#bar').text()).toBe('Bar Page')
|
|
expect(await browser.elementByCss('#foo').text()).toBe('Foo Page')
|
|
|
|
await next.patchFile('app/@bar/page.tsx', (content) =>
|
|
content.replace('Bar Page', 'Bar Page Updated')
|
|
)
|
|
|
|
await waitForNoRedbox(browser)
|
|
|
|
expect(await browser.elementByCss('#bar').text()).toBe('Bar Page Updated')
|
|
|
|
await next.patchFile('app/@foo/page.tsx', (content) =>
|
|
content.replace('Foo Page', 'Foo Page Updated')
|
|
)
|
|
|
|
await waitForNoRedbox(browser)
|
|
|
|
expect(await browser.elementByCss('#foo').text()).toBe('Foo Page Updated')
|
|
})
|
|
})
|