From 816007b994a83739536be6cb968eeb9b325feec4 Mon Sep 17 00:00:00 2001 From: "Xin Du (Clark)" Date: Fri, 17 Sep 2021 16:51:20 +0100 Subject: [PATCH] chore(test): fix external redirect link (#9816) Co-authored-by: Pooya Parsa --- test/dev/basic.ssr.test.js | 4 ++-- test/e2e/basic.browser.test.js | 2 +- test/fixtures/basic/pages/redirect-external-no-slash.vue | 2 +- test/fixtures/basic/pages/redirect-external.vue | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/dev/basic.ssr.test.js b/test/dev/basic.ssr.test.js index 743c5ea18f..0b547c5555 100644 --- a/test/dev/basic.ssr.test.js +++ b/test/dev/basic.ssr.test.js @@ -182,14 +182,14 @@ describe('basic ssr', () => { test('/redirect -> external link', async () => { 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(_headers.Location).toBe('https://example.com/test/') 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(_headers.Location).toBe('https://example.com/test') expect(html).toContain('
') }) diff --git a/test/e2e/basic.browser.test.js b/test/e2e/basic.browser.test.js index 85fc3357b2..578a859c4e 100644 --- a/test/e2e/basic.browser.test.js +++ b/test/e2e/basic.browser.test.js @@ -262,7 +262,7 @@ describe('basic browser', () => { await page.nuxt.navigate('/redirect-external', false) await page.waitForFunction( - () => window.location.href === 'https://nuxtjs.org/docs/2.x/features/data-fetching/' + () => window.location.href === 'https://example.com/test/' ) page.close() }) diff --git a/test/fixtures/basic/pages/redirect-external-no-slash.vue b/test/fixtures/basic/pages/redirect-external-no-slash.vue index 9b462960bd..36b16eff46 100644 --- a/test/fixtures/basic/pages/redirect-external-no-slash.vue +++ b/test/fixtures/basic/pages/redirect-external-no-slash.vue @@ -5,7 +5,7 @@ diff --git a/test/fixtures/basic/pages/redirect-external.vue b/test/fixtures/basic/pages/redirect-external.vue index 54aa843d53..01c2b9da08 100644 --- a/test/fixtures/basic/pages/redirect-external.vue +++ b/test/fixtures/basic/pages/redirect-external.vue @@ -5,7 +5,7 @@