Skip to content

fix(tests): drain view transition state between transition helper tests - #309

Merged
smalluban merged 1 commit into
mainfrom
fix-transition-test-leak
Aug 5, 2026
Merged

fix(tests): drain view transition state between transition helper tests#309
smalluban merged 1 commit into
mainfrom
fix-transition-test-leak

Conversation

@smalluban

Copy link
Copy Markdown
Contributor

The transition helper suite in test/spec/html.js fails on WebKit with Expected spy warn to have been called 2 times. It was called 1 times., which currently blocks CI on unrelated pull requests. The should render component test starts a real view transition but only waits 200ms via resolveTimeout, so it never waits for that transition to settle. Since src/template/helpers/transition.js keeps the current transition in module scope as transition.instance, the unfinished transition leaks into the next test.

That leakage is what made the following test observe two warnings: with a transition still in progress, both rendered elements hit the "already in progress" branch. Without the leak the correct, deterministic result is one warning, because the first element starts the transition and only the second one hits that branch. Chrome and Firefox happened to still be mid-transition and passed by accident, while WebKit settles the transition faster and produced the real count.

This drains the pending transition in afterEach by awaiting html.transition.instance.finished, so each test starts from a clean state, and updates the expectation to the deterministic value of one warning. The assertion now verifies exactly what the test name describes rather than relying on cross-test state. No library source is changed.

Verified locally on Chrome (579/579 passing); WebKit headless does not launch on macOS, so CI covers that browser.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@smalluban
smalluban merged commit 9105f49 into main Aug 5, 2026
1 check passed
@smalluban
smalluban deleted the fix-transition-test-leak branch August 5, 2026 11:22
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 99.957%. remained the same — fix-transition-test-leak into main

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