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) {