From 746b14319aa8c7b07f151868b63dda41d5baa670 Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Tue, 5 Jan 2021 16:44:39 +0330 Subject: [PATCH] fix(vue-app): add id attribute to `noopApp` (#8596) --- packages/vue-app/template/server.js | 2 +- test/dev/basic.ssr.test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vue-app/template/server.js b/packages/vue-app/template/server.js index c6250caca8..0fe341f0a3 100644 --- a/packages/vue-app/template/server.js +++ b/packages/vue-app/template/server.js @@ -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, '/') diff --git a/test/dev/basic.ssr.test.js b/test/dev/basic.ssr.test.js index fef1410991..acdc078ae8 100644 --- a/test/dev/basic.ssr.test.js +++ b/test/dev/basic.ssr.test.js @@ -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('
') + expect(html).toContain('
') }) 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('
') + expect(html).toContain('
') }) 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('
') + expect(html).toContain('
') }) })