Skip to content

Add tests for pausable Frame Rendering#635

Merged
dhh merged 2 commits intohotwired:mainfrom
seanpdoyle:turbo-frame-pausable-rendering
Jul 18, 2022
Merged

Add tests for pausable Frame Rendering#635
dhh merged 2 commits intohotwired:mainfrom
seanpdoyle:turbo-frame-pausable-rendering

Conversation

@seanpdoyle
Copy link
Copy Markdown
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