diff --git a/test/integration/client-navigation/test/index.test.js b/test/integration/client-navigation/test/index.test.js index 7817d5aca778..d6c00e0bbfd5 100644 --- a/test/integration/client-navigation/test/index.test.js +++ b/test/integration/client-navigation/test/index.test.js @@ -550,6 +550,21 @@ describe('Client Navigation', () => { }) describe('with hash changes', () => { + describe('check hydration mis-match', () => { + it('should not have hydration mis-match for hash link', async () => { + const browser = await webdriver(context.appPort, '/nav/hash-changes') + const browserLogs = await browser.log('browser') + let found = false + browserLogs.forEach((log) => { + console.log('log.message', log.message) + if (log.message.includes('Warning: Prop')) { + found = true + } + }) + expect(found).toEqual(false) + }) + }) + describe('when hash change via Link', () => { it('should not run getInitialProps', async () => { const browser = await webdriver(context.appPort, '/nav/hash-changes') diff --git a/test/integration/link-with-hash/pages/index.js b/test/integration/link-with-hash/pages/index.js deleted file mode 100644 index f39a8ed7342d..000000000000 --- a/test/integration/link-with-hash/pages/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react' -import Link from 'next/link' - -const Home = () => { - return ( - <> - - Hash Link - - - ) -} - -export default Home diff --git a/test/integration/link-with-hash/test/index.test.js b/test/integration/link-with-hash/test/index.test.js deleted file mode 100644 index 365cade8ad9b..000000000000 --- a/test/integration/link-with-hash/test/index.test.js +++ /dev/null @@ -1,53 +0,0 @@ -/* eslint-env jest */ - -import { join } from 'path' -import webdriver from 'next-webdriver' -import { - findPort, - launchApp, - killApp, - nextStart, - nextBuild, -} from 'next-test-utils' - -jest.setTimeout(1000 * 60 * 5) -let app -let appPort -const appDir = join(__dirname, '..') - -const runTests = () => { - it('should not have hydration mis-match for hash link', async () => { - const browser = await webdriver(appPort, '/') - const browserLogs = await browser.log('browser') - let found = false - browserLogs.forEach((log) => { - if (log.message.includes('Warning: Prop')) { - found = true - } - }) - expect(found).toEqual(false) - }) -} - -describe('Link with hash href', () => { - describe('development', () => { - beforeAll(async () => { - appPort = await findPort() - app = await launchApp(appDir, appPort) - }) - afterAll(() => killApp(app)) - - runTests() - }) - - describe('production', () => { - beforeAll(async () => { - await nextBuild(appDir) - appPort = await findPort() - app = await nextStart(appDir, appPort) - }) - afterAll(() => killApp(app)) - - runTests() - }) -})