Skip to content

Commit

Permalink
CI: Restore passing tests (#725)
Browse files Browse the repository at this point in the history
With the reverting of [#569][] (merged as
[#723][]), the "Visit with network error" test coverage
was missed in the diff.

Prior to the revert, the test was listening for
`turbo:fetch-request-error` events dispatched on the _link_ that was
clicked. Since that's no longer the case, this commit changes the test
to listen for `turbo:fetch-request-error` that bubble up to the
document.

[#569]: #569
[#723]: #723
  • Loading branch information
seanpdoyle committed Sep 19, 2022
1 parent a1be115 commit 33617b7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/tests/functional/visit_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
isScrolledToTop,
nextBeat,
nextEventNamed,
nextEventOnTarget,
noNextAttributeMutationNamed,
readEventLogs,
scrollToSelector,
Expand Down Expand Up @@ -209,7 +208,7 @@ test("test Visit with network error", async ({ page }) => {
})
await page.context().setOffline(true)
await page.click("#same-origin-link")
await nextEventOnTarget(page, "same-origin-link", "turbo:fetch-request-error")
await nextEventNamed(page, "turbo:fetch-request-error")
})

async function visitLocation(page: Page, location: string) {
Expand Down

0 comments on commit 33617b7

Please sign in to comment.