Skip to content

test: await hydration before clicking counter (fix flaky tests) - #232

Merged
brillout merged 1 commit into
mainfrom
claude/youthful-cerf-5ih52a
Oct 2, 2026
Merged

brillout merged 1 commit into
mainfrom
claude/youthful-cerf-5ih52a

Conversation

@brillout

@brillout brillout commented Oct 2, 2026

Copy link
Copy Markdown
Member

Port of vikejs/vike#3570.

Clicking the counter repeatedly inside autoRetry() until the value changes is flaky: a click can land while the previous one is still being processed, so the value can go past the expected number. Instead, the tests now wait for hydration (window._vike.fullyRenderedUrl), click once, and then use autoRetry() only for the assertion.

Applied to the same pattern in:

  • examples/minimal/.testRun.ts
  • examples/redux/.testRun.ts
  • examples/zustand/.testRun.ts
  • examples/sentry/.testRun.ts

Verified locally: all e2e test files for these four examples pass (dev + preview/prod).

馃 Generated with Claude Code

https://claude.ai/code/session_01EpJz8JiJnc1w9sPetPpxD6


Generated by Claude Code

Clicking repeatedly inside autoRetry() until the value changes is flaky:
a click can land while the previous one is still being processed,
overshooting the expected value. Port of vikejs/vike#3570.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EpJz8JiJnc1w9sPetPpxD6
@brillout
brillout merged commit b9a4cc4 into main Oct 2, 2026
7 checks passed
@brillout
brillout deleted the claude/youthful-cerf-5ih52a branch October 2, 2026 13:36
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.

2 participants