test: add page transition

This commit is contained in:
Julien Huang 2024-06-25 18:53:38 +02:00
parent 16469917d5
commit 530b4cc76e
3 changed files with 19 additions and 2 deletions

View File

@ -523,7 +523,7 @@ describe('pages', () => {
// that page should be client rendered
// TODO: investigate why multiple elements are appearing on page
expect(await clientInitialPage.locator('#server-rendered').first().textContent()).toMatchInlineSnapshot('"false"')
expect(await clientInitialPage.locator('#server-rendered').textContent()).toMatchInlineSnapshot('"false"')
// and not contain any errors or warnings
expect(errors.length).toBe(0)

17
test/fixtures/basic/app.vue vendored Normal file
View File

@ -0,0 +1,17 @@
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>
<style>
.page-enter-active,
.page-leave-active {
transition: all 0.1s;
}
.page-enter-from,
.page-leave-to {
opacity: 0;
filter: blur(1rem);
}
</style>

View File

@ -13,7 +13,7 @@ declare module 'nitropack' {
export default defineNuxtConfig({
app: {
pageTransition: true,
pageTransition: { name: 'page', mode: 'out-in' },
layoutTransition: true,
teleportId: 'nuxt-teleport',
teleportTag: 'span',