test(webui): deflake SettingsPage dynamic-tools toggle tests#1938
test(webui): deflake SettingsPage dynamic-tools toggle tests#1938itomek wants to merge 2 commits into
Conversation
Two dynamic-tools tests grabbed the toggle as soon as it existed and
immediately asserted its final state. The toggle renders disabled and
unchecked while getSettings is in flight, so slow CI runners asserted
against the loading state ("element is not checked ... disabled").
Wait for the loaded state inside waitFor, as the file's other five
tests already do.
|
Verdict: Approve ✅ This deflakes two SettingsPage toggle tests that grabbed the dynamic-tools control while it was still loading (disabled + unchecked) and asserted its final state immediately, so slow CI runners lost the race. Both now wait for a loaded-state signal before asserting — the same 🔍 Technical detailsCorrectness of the wait conditions — both new predicates correctly discriminate the loaded state from the loading state, which is the whole point:
Switching from a captured Strengths
|
|
Superseded — main already fixed this flake more comprehensively in #1931 (findLoadedDynamicToolsToggle helper + loaded-state waits across the describe block), which is what this branch now conflicts with. Nothing here survives the rebase. |
Pull request was closed
Fixes #1937.
Two SettingsPage tests raced the settings fetch: they grabbed the dynamic-tools toggle as soon as it rendered (disabled + unchecked while loading) and immediately asserted its final state, which fails on slow CI runners — seen on PR #1930's "Test Agent UI Components (Vitest)" run against code that doesn't touch the UI. Both now wait for the loaded state inside
waitFor, the pattern the file's other five tests already use. Test-only change; no component code touched.Test plan
cd src/gaia/apps/webui && npx vitest run src/components/__tests__/SettingsPage.test.tsx→ 7 passed (verified 3× in a row locally)npx vitest run(full webui suite) → 13 files / 109 tests passed