mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 06:05:11 +00:00
fix(vue-app): add id attribute to noopApp
(#8596)
This commit is contained in:
parent
c15078fa64
commit
746b14319a
@ -31,7 +31,7 @@ Vue.component(NuxtLink.name, NuxtLink)
|
||||
|
||||
<% if (fetch.server) { %>if (!global.fetch) { global.fetch = fetch }<% } %>
|
||||
|
||||
const noopApp = () => new Vue({ render: h => h('div') })
|
||||
const noopApp = () => new Vue({ render: h => h('div', { domProps: { id: '<%= globals.id %>' } }) })
|
||||
|
||||
function urlJoin () {
|
||||
return Array.prototype.slice.call(arguments).join('/').replace(/\/+/g, '/')
|
||||
|
@ -183,21 +183,21 @@ describe('basic ssr', () => {
|
||||
const { html } = await nuxt.server.renderRoute('/redirect-external', renderContext)
|
||||
expect(_status).toBe(302)
|
||||
expect(_headers.Location).toBe('https://nuxtjs.org/docs/2.x/features/data-fetching/')
|
||||
expect(html).toContain('<div data-server-rendered="true"></div>')
|
||||
expect(html).toContain('<div data-server-rendered="true" id="__nuxt"></div>')
|
||||
})
|
||||
|
||||
test('/redirect -> external link without trailing slash', async () => {
|
||||
const { html } = await nuxt.server.renderRoute('/redirect-external-no-slash', renderContext)
|
||||
expect(_status).toBe(302)
|
||||
expect(_headers.Location).toBe('https://nuxtjs.org/docs/2.x/features/data-fetching')
|
||||
expect(html).toContain('<div data-server-rendered="true"></div>')
|
||||
expect(html).toContain('<div data-server-rendered="true" id="__nuxt"></div>')
|
||||
})
|
||||
|
||||
test('/redirect -> external link with root domain url', async () => {
|
||||
const { html } = await nuxt.server.renderRoute('/redirect-external-root', renderContext)
|
||||
expect(_status).toBe(302)
|
||||
expect(_headers.Location).toBe('https://nuxtjs.org/')
|
||||
expect(html).toContain('<div data-server-rendered="true"></div>')
|
||||
expect(html).toContain('<div data-server-rendered="true" id="__nuxt"></div>')
|
||||
})
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user