Skip to content

Commit ab8b33d

Browse files
ztannervercel[bot]
andauthored
Update test/e2e/app-dir/app-client-cache/client-cache.parallel-routes.test.ts
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
1 parent 18d8881 commit ab8b33d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/e2e/app-dir/app-client-cache/client-cache.parallel-routes.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,25 @@ describe('app dir client cache with parallel routes', () => {
112112
await browser.eval(fastForwardTo, 5 * 60 * 1000)
113113

114114
// Toggle the link to the other page again, assert on prefetch content
115-
await act(
115+
const linkAfterExpiry = await act(
116116
async () => {
117117
const reveal = await browser.elementByCss(
118118
'[data-link-accordion="/0"]'
119119
)
120120
await reveal.click()
121-
await browser.elementByCss('[href="/0"]')
121+
return await browser.elementByCss('[href="/0"]')
122122
},
123123
{ includes: 'random-number' }
124124
)
125+
126+
// Navigate to the page and verify the content is fresh (different from cached)
127+
const newNumber = await act(async () => {
128+
await linkAfterExpiry.click()
129+
await browser.waitForElementByCss('#random-number')
130+
return await browser.elementByCss('#random-number').text()
131+
}, 'no-requests')
132+
133+
expect(newNumber).not.toBe(randomNumber)
125134
})
126135
})
127136
})

0 commit comments

Comments
 (0)