mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
When `router.refresh` or a server action creates a new `CacheNode` tree, we were erroneously not copying over the `loading` segment in the new tree. This would cause the subtree to be remounted as the loading segment switched from having a Suspense boundary to not having one. Fixes #66029 Fixes #66499
33 lines
904 B
TypeScript
33 lines
904 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { retry } from 'next-test-utils'
|
|
|
|
describe('actions-revalidate-remount', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should not remount the page + loading component when revalidating', async () => {
|
|
const browser = await next.browser('/test')
|
|
const initialTime = await browser.elementById('time').text()
|
|
|
|
expect(initialTime).toMatch(/Time: \d+/)
|
|
|
|
await browser.elementByCss('button').click()
|
|
|
|
await retry(async () => {
|
|
const time = await browser.elementById('time').text()
|
|
expect(time).toMatch(/Time: \d+/)
|
|
|
|
// The time should be updated
|
|
expect(initialTime).not.toBe(time)
|
|
|
|
const logs = (await browser.log()).filter(
|
|
(log) => log.message === 'Loading Mounted'
|
|
)
|
|
|
|
// There should not be any loading logs
|
|
expect(logs.length).toBe(0)
|
|
})
|
|
})
|
|
})
|