From 19b7602d24cfcadd658ee90b24803553a898146b Mon Sep 17 00:00:00 2001 From: Hendrik Liebau Date: Fri, 31 May 2024 22:21:03 +0200 Subject: [PATCH 1/2] Avoid race condition in ppr navigations test --- test/e2e/app-dir/ppr-navigations/simple/simple.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/app-dir/ppr-navigations/simple/simple.test.ts b/test/e2e/app-dir/ppr-navigations/simple/simple.test.ts index 930f953bf70e1..26f7858cb0459 100644 --- a/test/e2e/app-dir/ppr-navigations/simple/simple.test.ts +++ b/test/e2e/app-dir/ppr-navigations/simple/simple.test.ts @@ -10,7 +10,7 @@ describe('ppr-navigations simple', () => { const browser = await next.browser('/') try { - for (const { href } of links) { + for (const { href } of [...links].reverse()) { // Find the link element for the href and click it. await browser.elementByCss(`a[href="${href}"]`).click() From be17583e54185fd77eea113752ea1c24fe0048b6 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Wed, 5 Jun 2024 15:35:05 +0200 Subject: [PATCH 2/2] Be explicit what we do Wet tests are fine. They make it easier to reason about what is going on when focusing on a test. --- test/e2e/app-dir/ppr-navigations/simple/simple.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/app-dir/ppr-navigations/simple/simple.test.ts b/test/e2e/app-dir/ppr-navigations/simple/simple.test.ts index 26f7858cb0459..b09008793065e 100644 --- a/test/e2e/app-dir/ppr-navigations/simple/simple.test.ts +++ b/test/e2e/app-dir/ppr-navigations/simple/simple.test.ts @@ -1,5 +1,5 @@ import { nextTestSetup } from 'e2e-utils' -import { links, locales } from './components/page' +import { locales } from './components/page' describe('ppr-navigations simple', () => { const { next } = nextTestSetup({ @@ -10,7 +10,7 @@ describe('ppr-navigations simple', () => { const browser = await next.browser('/') try { - for (const { href } of [...links].reverse()) { + for (const href of ['/fr/about', '/fr', '/en/about', '/en', '/']) { // Find the link element for the href and click it. await browser.elementByCss(`a[href="${href}"]`).click()