Files
next.js/test/e2e/app-dir/ppr-history-replace-state/ppr-history-replace-state.test.ts
99a92826f6 ppr: prevent CacheNode.loading from being cleared on popstate (#68488)
When PPR was enabled, the "restore" action in PPR was causing the
`loading` boundary for the visible `CacheNode` to lose it's `loading`.
This caused the `Suspense` boundary that contained the loading
information to disappear, which in turn caused the tree to remount since
it wraps all the page children.

I can't think of a reason why we'd not want to preserve the existing
`loading` data here, as it's not tied to the prefetch.

closes #68484

---------

Co-authored-by: Hendrik Liebau <[email protected]>
2024-08-03 05:55:59 -07:00

15 lines
438 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
describe('ppr-history-replace-state', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('should not remount component', async () => {
const browser = await next.browser('/')
await await browser.elementByCss('input').type('a')
// When the input is remounted, its value is cleared.
expect(await browser.elementByCss('input').getValue()).toBe('a')
})
})