mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
no-ssr: Add tests
This commit is contained in:
parent
222f50e139
commit
e90a753d8d
@ -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('<div class="no-ssr-placeholder"><p>Loading...</p></div>'))
|
||||
})
|
||||
|
||||
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('<h1>Displayed only on client-side</h1>'))
|
||||
})
|
||||
|
||||
test('ETag Header', async t => {
|
||||
const { headers: { etag } } = await rp(url('/stateless'), { resolveWithFullResponse: true })
|
||||
// Validate etag
|
||||
|
5
test/fixtures/basic/pages/no-ssr.vue
vendored
Normal file
5
test/fixtures/basic/pages/no-ssr.vue
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<no-ssr placeholder="<p>Loading...</p>">
|
||||
<h1>Displayed only on client-side</h1>
|
||||
</no-ssr>
|
||||
</template>
|
Loading…
Reference in New Issue
Block a user