Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wait on
turbo:load
events during History visits
When navigating with `this.goBack()` and `this.goForward()`, synchronize the timing by waiting on `turbo:load` events instead of the `this.nextBody` hook firing. During a restoration visit (triggered by `this.goBack()` or `this.goForward()`), the [`turbo:render`][render] event will fire once when restoring the cached snapshot, and a second time when the contents are refreshed from a request to the server. By waiting on the `turbo:load` event, the test won't proceed until that process is complete, which will hopefully limit the possibility of referencing stale elements. [render]: https://turbo.hotwired.dev/reference/events
- Loading branch information