mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
test: disable pageTransition
in client-only page (#27839)
This commit is contained in:
parent
d5023955d3
commit
e5a7a58d49
@ -533,8 +533,7 @@ describe('pages', () => {
|
|||||||
await clientInitialPage.waitForFunction(() => window.useNuxtApp?.()._route.fullPath === '/client-only-page/normal')
|
await clientInitialPage.waitForFunction(() => window.useNuxtApp?.()._route.fullPath === '/client-only-page/normal')
|
||||||
|
|
||||||
// that page should be client rendered
|
// that page should be client rendered
|
||||||
// TODO: investigate why multiple elements are appearing on page
|
expect(await clientInitialPage.locator('#server-rendered').textContent()).toMatchInlineSnapshot('"false"')
|
||||||
expect(await clientInitialPage.locator('#server-rendered').first().textContent()).toMatchInlineSnapshot('"false"')
|
|
||||||
// and not contain any errors or warnings
|
// and not contain any errors or warnings
|
||||||
expect(errors.length).toBe(0)
|
expect(errors.length).toBe(0)
|
||||||
|
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
definePageMeta({
|
||||||
|
// Disable page transition for this page to avoid having multiple time the same page during transition
|
||||||
|
pageTransition: false,
|
||||||
|
layoutTransition: false,
|
||||||
|
})
|
||||||
|
|
||||||
const state = useState('test', () => {
|
const state = useState('test', () => {
|
||||||
let hasAccessToWindow = null as null | boolean
|
let hasAccessToWindow = null as null | boolean
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const renderedOnServer = useState(() => import.meta.server)
|
const renderedOnServer = useState(() => import.meta.server)
|
||||||
|
definePageMeta({
|
||||||
|
// Disable page transition for this page to avoid having multiple time the same page during transition
|
||||||
|
pageTransition: false,
|
||||||
|
layoutTransition: false,
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
Loading…
Reference in New Issue
Block a user