From 6bbbe487f2a6411a323d1fdcfe34bf004b13e1fb Mon Sep 17 00:00:00 2001 From: Zack Tanner <1939140+ztanner@users.noreply.github.com> Date: Tue, 1 Oct 2024 08:14:01 -0700 Subject: [PATCH] fix invalid test --- packages/next/src/server/app-render/types.ts | 4 ++-- .../revalidatetag-rsc/revalidatetag-rsc.test.ts | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/next/src/server/app-render/types.ts b/packages/next/src/server/app-render/types.ts index 5e6a54aec49a8c..72efe4743ee4c5 100644 --- a/packages/next/src/server/app-render/types.ts +++ b/packages/next/src/server/app-render/types.ts @@ -223,7 +223,7 @@ export type InitialRSCPayload = { G: React.ComponentType /** postponed */ s: boolean - /** isPrerender */ + /** prerendered */ S: boolean } @@ -233,7 +233,7 @@ export type NavigationFlightResponse = { b: string /** flightData */ f: FlightData - /** isPrerender */ + /** prerendered */ S: boolean } diff --git a/test/e2e/app-dir/revalidatetag-rsc/revalidatetag-rsc.test.ts b/test/e2e/app-dir/revalidatetag-rsc/revalidatetag-rsc.test.ts index 5355fb7d1c602f..a35b3258afcfde 100644 --- a/test/e2e/app-dir/revalidatetag-rsc/revalidatetag-rsc.test.ts +++ b/test/e2e/app-dir/revalidatetag-rsc/revalidatetag-rsc.test.ts @@ -27,12 +27,16 @@ describe('revalidateTag-rsc', () => { await browser.refresh() const randomNumber2 = await browser.elementById('data').text() expect(randomNumber).toEqual(randomNumber2) - await browser.elementByCss('#revalidate-via-page').click() await browser.waitForElementByCss('#home') await browser.elementByCss('#home').click() await browser.waitForElementByCss('#data') - const randomNumber3 = await browser.elementById('data').text() - expect(randomNumber3).not.toEqual(randomNumber) + await retry(async () => { + // need to refresh to evict client router cache + await browser.refresh() + await browser.waitForElementByCss('#data') + const randomNumber3 = await browser.elementById('data').text() + expect(randomNumber3).not.toEqual(randomNumber) + }) }) })