mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This hard deprecates the `experimental.ppr` configuration, requiring users to opt-in instead via `experimental.cacheComponents`. This does mean that the previous `experimental.ppr = "incremental"` will no longer be supported. NAR-433
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
function countSubstring(str: string, substr: string): number {
|
|
return str.split(substr).length - 1
|
|
}
|
|
|
|
// TODO(NAR-423): Migrate to Cache Components.
|
|
describe.skip('ppr-metadata-blocking-ppr-fallback', () => {
|
|
const { next, skipped } = nextTestSetup({
|
|
files: __dirname,
|
|
// Need to skip deployment because the test uses the private env cannot be used in deployment
|
|
skipDeployment: true,
|
|
env: {
|
|
__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING: '1',
|
|
},
|
|
})
|
|
|
|
if (skipped) return
|
|
|
|
it('should not include metadata in partial shell when page is fully dynamic', async () => {
|
|
const $ = await next.render$('/fully-dynamic?__nextppronly=fallback')
|
|
expect(countSubstring($.html(), '<title>')).toBe(0)
|
|
})
|
|
|
|
it('should include viewport metadata in partial shell when metadata is dynamic under suspense', async () => {
|
|
const $ = await next.render$(
|
|
'/dynamic-metadata/partial?__nextppronly=fallback'
|
|
)
|
|
expect(countSubstring($.html(), '<title>')).toBe(0)
|
|
expect(countSubstring($.html(), '<meta name="viewport"')).toBe(1)
|
|
})
|
|
|
|
it('should include viewport metadata in partial shell when page is partially dynamic', async () => {
|
|
const $ = await next.render$('/dynamic-page/partial?__nextppronly=fallback')
|
|
expect($('head title').text()).toBe('dynamic-page - partial')
|
|
expect(countSubstring($.html(), '<title>')).toBe(1)
|
|
expect(countSubstring($.html(), '<meta name="viewport"')).toBe(1)
|
|
})
|
|
})
|