Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for pausable Frame Rendering #635

Merged
merged 2 commits into from
Jul 18, 2022

Conversation

seanpdoyle
Copy link
Contributor

Follow-up to #431

Support for the turbo:before-frame-render event relies on the same
underlying infrastructure as the turbo:before-render event (i.e. the
Renderer abstract class). As a result of re-using that abstraction,
listeners for the turbo:before-frame-render event can also leverage
the detail.resume function in the same way to handle asynchronous
rendering.

The changes made in hotwired/turbo#431 excluded test coverage for
that behavior. This commit adds that coverage to guard against
regressions in that behvaior.

Follow-up to hotwired#431

Support for the `turbo:before-frame-render` event relies on the same
underlying infrastructure as the `turbo:before-render` event (i.e. the
`Renderer` abstract class). As a result of re-using that abstraction,
listeners for the `turbo:before-frame-render` event can also leverage
the `detail.resume` function in the same way to handle asynchronous
rendering.

The changes made in [hotwired#431][] excluded test coverage for
that behavior. This commit adds that coverage to guard against
regressions in that behvaior.

[hotwired#431]: hotwired#431
@seanpdoyle seanpdoyle force-pushed the turbo-frame-pausable-rendering branch from f8ac6c6 to 59c9520 Compare July 18, 2022 17:01
Follow-up to hotwired#633

The flaky test outlined in [hotwired#633][] was "flaky", but not
in the sense that was originally suspected. Somehow, it was presenting
as a false negative, failing when we thought it should consistently
pass.

On further inspection, it was _passing when it should consistently
fail_.

This commit addresses the underlying issue by copying any
`[data-turbo-frame]` attributes onto the `<form>` element from the `<a>`
element that is clicked outside of the targeted `<turbo-frame>`.

[hotwired#633]: hotwired#633
@dhh dhh merged commit ddef79f into hotwired:main Jul 18, 2022
@seanpdoyle seanpdoyle deleted the turbo-frame-pausable-rendering branch July 18, 2022 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants