From 1512a2402da7b13aeb5d0827a75b8c8fc87115e5 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 16 Oct 2023 11:38:22 +0100 Subject: [PATCH] test: add test for new resolution behaviour --- packages/nuxt/test/app.test.ts | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/packages/nuxt/test/app.test.ts b/packages/nuxt/test/app.test.ts index c72091a80e..7bebd5a6fe 100644 --- a/packages/nuxt/test/app.test.ts +++ b/packages/nuxt/test/app.test.ts @@ -179,6 +179,40 @@ describe('resolveApp', () => { } `) }) + + it('resolves nested layouts correctly', async () => { + const app = await getResolvedApp([ + 'layouts/default.vue', + 'layouts/some/layout.vue', + 'layouts/SomeOther.vue', + 'layouts/some.vue', + 'layouts/SomeOther/layout.ts' + ]) + expect(app.layouts).toMatchInlineSnapshot(` + { + "default": { + "file": "/layouts/default.vue", + "name": "default", + }, + "some": { + "file": "/layouts/some.vue", + "name": "some", + }, + "some-layout": { + "file": "/layouts/some/layout.vue", + "name": "some-layout", + }, + "some-other": { + "file": "/layouts/SomeOther.vue", + "name": "some-other", + }, + "some-other-layout": { + "file": "/layouts/SomeOther/layout.ts", + "name": "some-other-layout", + }, + } + `) + }) }) async function getResolvedApp (files: Array) {