Skip to content

Commit

Permalink
Change in behavior with async metadata and prefetch
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Nov 22, 2024
1 parent 225baf5 commit a24fae3
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions test/e2e/app-dir/navigation/navigation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -891,23 +891,10 @@ describe('app dir - navigation', () => {
.elementByCss("[href='/metadata-await-promise/nested']")
.click()

if (!isNextDev) {
// next-dev has no prefetch
expect(
await browser
.waitForElementByCss(
'#loading',
// Wait a bit longer than the prefetch duration since the click takes a while to register and the fallback render also takes time.
resolveMetadataDuration + 500
)
.text()
).toEqual('Loading')
expect(await browser.elementByCss('title').text()).toBe('Async Title')
}

await waitFor(resolveMetadataDuration)

expect(await browser.elementById('page-content').text()).toBe('Content')
expect(await browser.elementByCss('title').text()).toBe('Async Title')
})

it('shows a fallback when prefetch completed', async () => {
Expand Down

0 comments on commit a24fae3

Please sign in to comment.