From e90a753d8dfc34e22fce624a27b046c6e8add0c9 Mon Sep 17 00:00:00 2001 From: Sebastien Chopin Date: Thu, 24 Aug 2017 12:46:30 +0200 Subject: [PATCH] no-ssr: Add tests --- test/basic.test.js | 11 +++++++++++ test/fixtures/basic/pages/no-ssr.vue | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 test/fixtures/basic/pages/no-ssr.vue diff --git a/test/basic.test.js b/test/basic.test.js index 624916b74d..2b7a4093d5 100755 --- a/test/basic.test.js +++ b/test/basic.test.js @@ -148,6 +148,17 @@ test('/redirect2', async t => { t.true(output.stderr.length === 0) }) +test('/no-ssr', async t => { + const { html } = await nuxt.renderRoute('/no-ssr') + t.true(html.includes('
<p>Loading...</p>
')) +}) + +test('/no-ssr (clien-side)', async t => { + const window = await nuxt.renderAndGetWindow(url('/no-ssr')) + const html = window.document.body.innerHTML + t.true(html.includes('

Displayed only on client-side

')) +}) + test('ETag Header', async t => { const { headers: { etag } } = await rp(url('/stateless'), { resolveWithFullResponse: true }) // Validate etag diff --git a/test/fixtures/basic/pages/no-ssr.vue b/test/fixtures/basic/pages/no-ssr.vue new file mode 100644 index 0000000000..67fa89a764 --- /dev/null +++ b/test/fixtures/basic/pages/no-ssr.vue @@ -0,0 +1,5 @@ +