From eebc44dca44fe02d59cbb099d7945b820daefa1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Sat, 24 Dec 2016 18:50:40 +0100 Subject: [PATCH] Add tests for layouts --- test/fixtures/with-config/layouts/custom.vue | 6 ++++++ test/fixtures/with-config/pages/about.vue | 6 ++++++ test/with-config.test.js | 8 ++++++++ 3 files changed, 20 insertions(+) create mode 100644 test/fixtures/with-config/layouts/custom.vue diff --git a/test/fixtures/with-config/layouts/custom.vue b/test/fixtures/with-config/layouts/custom.vue new file mode 100644 index 0000000000..44d4c1721f --- /dev/null +++ b/test/fixtures/with-config/layouts/custom.vue @@ -0,0 +1,6 @@ + diff --git a/test/fixtures/with-config/pages/about.vue b/test/fixtures/with-config/pages/about.vue index 93009e1b3e..39572c46f1 100644 --- a/test/fixtures/with-config/pages/about.vue +++ b/test/fixtures/with-config/pages/about.vue @@ -4,3 +4,9 @@ Home page + + diff --git a/test/with-config.test.js b/test/with-config.test.js index fa6cf141fc..51304ad44a 100644 --- a/test/with-config.test.js +++ b/test/with-config.test.js @@ -27,9 +27,17 @@ test('/', async t => { test('/test/ (router base)', async t => { const window = await nuxt.renderAndGetWindow(url('/test/')) const html = window.document.body.innerHTML + t.true(html.includes('

Default layout

')) t.true(html.includes('

I have custom configurations

')) }) +test('/test/about (custom layout)', async t => { + const window = await nuxt.renderAndGetWindow(url('/test/about')) + const html = window.document.body.innerHTML + t.true(html.includes('

Custom layout

')) + t.true(html.includes('

About page

')) +}) + test('/test/env', async t => { const window = await nuxt.renderAndGetWindow(url('/test/env')) const html = window.document.body.innerHTML