diff --git a/test/production/app-dir-prefetch-non-iso-url/index.test.ts b/test/production/app-dir-prefetch-non-iso-url/index.test.ts index dfb4c6219798..28625dbe8164 100644 --- a/test/production/app-dir-prefetch-non-iso-url/index.test.ts +++ b/test/production/app-dir-prefetch-non-iso-url/index.test.ts @@ -3,7 +3,6 @@ import { NextInstance } from 'test/lib/next-modes/base' import { join } from 'path' import { BrowserInterface } from '../../lib/browsers/base' import webdriver from 'next-webdriver' -import { waitFor } from 'next-test-utils' describe('app-dir-prefetch-non-iso-url', () => { let next: NextInstance @@ -18,6 +17,22 @@ describe('app-dir-prefetch-non-iso-url', () => { }) afterAll(() => next.destroy()) + it('should go to iso url', async () => { + let browser: BrowserInterface + + try { + browser = await webdriver(next.appPort, '/') + await browser.elementByCss('#to-iso').click() + + const text = await browser.elementByCss('#page').text() + expect(text).toBe('/[slug]') + } finally { + if (browser) { + await browser.close() + } + } + }) + it('should go to non-iso url', async () => { let browser: BrowserInterface @@ -25,9 +40,8 @@ describe('app-dir-prefetch-non-iso-url', () => { browser = await webdriver(next.appPort, '/') await browser.elementByCss('#to-non-iso').click() - await waitFor(3000) - - expect(browser.elementByCss('#page')).toBe('/[slug]') + const text = await browser.elementByCss('#page').text() + expect(text).toBe('/[slug]') } finally { if (browser) { await browser.close()