From f5e56c73f9e7fbc0a1defe4de94816317e1cddc5 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Mon, 28 Feb 2022 23:18:37 +0100 Subject: [PATCH] move test --- .../client-navigation/test/index.test.js | 23 ------------------- .../test/streaming.js | 23 +++++++++++++++++-- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/test/integration/client-navigation/test/index.test.js b/test/integration/client-navigation/test/index.test.js index 39f3d2e20d1c..2414ac400a1a 100644 --- a/test/integration/client-navigation/test/index.test.js +++ b/test/integration/client-navigation/test/index.test.js @@ -1430,29 +1430,6 @@ describe('Client Navigation', () => { } }) - it('should warn when scripts are in head', async () => { - let browser - try { - browser = await webdriver(context.appPort, '/head') - - await browser.waitForElementByCss('h1') - await waitFor(2000) - const browserLogs = await browser.log('browser') - let found = false - browserLogs.forEach((log) => { - console.log('log.message', log.message) - if (log.message.includes('Use next/script instead')) { - found = true - } - }) - expect(found).toEqual(true) - } finally { - if (browser) { - await browser.close() - } - } - }) - it('should update head during client routing', async () => { let browser try { diff --git a/test/integration/react-streaming-and-server-components/test/streaming.js b/test/integration/react-streaming-and-server-components/test/streaming.js index da937ac934f4..edfeccebdcd8 100644 --- a/test/integration/react-streaming-and-server-components/test/streaming.js +++ b/test/integration/react-streaming-and-server-components/test/streaming.js @@ -135,17 +135,36 @@ export default function (context, { env }) { } }) + it('should warn when scripts are in head', async () => { + let browser + try { + browser = await webdriver(context.appPort, '/head') + await browser.waitForElementByCss('h1') + await waitFor(1000) + const browserLogs = await browser.log('browser') + let found = false + browserLogs.forEach((log) => { + if (log.message.includes('Use next/script instead')) { + found = true + } + }) + expect(found).toEqual(true) + } finally { + if (browser) { + await browser.close() + } + } + }) + it('should not warn when application/ld+json scripts are in head', async () => { let browser try { browser = await webdriver(context.appPort, '/head-with-json-ld-snippet') - await browser.waitForElementByCss('h1') await waitFor(1000) const browserLogs = await browser.log('browser') let found = false browserLogs.forEach((log) => { - // console.log('log.message', log.message) if (log.message.includes('Use next/script instead')) { found = true }