Skip to content

test(sing): wait for the singer app's state before touching it - #317

Merged
beveradb merged 1 commit into
mainfrom
fix/sess-20261108-1833-name-screen-test-flake
Nov 8, 2026
Merged

beveradb merged 1 commit into
mainfrom
fix/sess-20261108-1833-name-screen-test-flake

Conversation

@beveradb

@beveradb beveradb commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Fixes an order-dependent e2e failure (test_search_step_without_a_name_renders_the_name_screen failed with Cannot set properties of undefined (setting 'name') when run after the make-it tests, on main too).

Cause: sing.js runs await initI18n(...) at the top level before it sets window.__sing_state. The page's load event doesn't wait for that, so page.goto could return before the state existed, and the test lost the race whenever the messages fetch was slow.

Fix: page.wait_for_function("!!window.__sing_state") in _login (used by most singer tests) and at the 4 direct goto sites that touch the state, which is how the consent tests already handle it. A scan of all tests found no other unguarded sites.

Verified: the failing combination (make_wizard + i18n_footer + frontend) passes twice. Full tests/e2e: 414 passed. Test-only, so no version bump.

@coderabbitai ignore

🤖 Generated with Claude Code

https://claude.ai/code/session_012RYLVUsjX5ETS5xYmCaam4

sing.js awaits its translations (top-level await) before exposing
window.__sing_state, and page.goto's load event doesn't wait for that. When the
message fetch was slow (e.g. right after the make-it tests), evaluate hit an
undefined __sing_state. Wait for it in _login and the four direct goto sites,
like the consent tests already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012RYLVUsjX5ETS5xYmCaam4
@beveradb
beveradb merged commit b93079e into main Nov 8, 2026
1 check passed
@beveradb
beveradb deleted the fix/sess-20261108-1833-name-screen-test-flake branch November 8, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant