Repository navigation
test(onboarding): fix flaky SaveDraftButton advance test - #1567
Merged
Merged
Conversation
Wait for the step to reappear after save draft succeeds instead of asserting synchronously, and assert Contract Details is not shown. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (291 total)
✅ Bundle size check passed |
Contributor
|
Deploy preview for adp-cost-calculator ready!
Deployed with vercel-action |
Contributor
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
Contributor
📊 Coverage Report⚪ Coverage unchanged
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
remotecom
approved these changes
Oct 14, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a flaky unit test that intermittently fails the "Generate Base Coverage" CI job. No product code changes.
Why
SaveDraftButton > should not advance to next step when save draft is clickedfailed once in CI (run, PR #1566) and passed on retry. The final assertion ran before the flow finished reloading, so it saw only the loading spinner.What changed
Toggle details
onSuccessfires, the new employment is fetched andisLoadingbriefly flips back to true, so the render prop returns the spinner.getByText, which raced that window.await findByTextfor the Basic Information step, and also assertsStep: Contract Detailsis not rendered, so the test still proves the flow didn't advance.Screenshots
N/A
Related Resources
Testing
SaveDraftButton.test.tsx3 times locally: 12/12 passing each time.example/app in a browser: N/A (test-only)🤖 Generated with Claude Code
Note
Low Risk
Test-only assertion timing change with no production code or API impact.
Overview
Stabilizes the Save Draft onboarding test that checks the flow does not advance after a successful draft save.
The final check now waits for
Step: Basic InformationwithfindByTextinstead of a synchronousgetByText, so it no longer races the brief loading state afteronSuccesswhen the employment is refetched. It also asserts Contract Details is absent, preserving the “stay on the same step” intent.Test-only change; no production behavior updates.
Reviewed by Cursor Bugbot for commit 1d9b5a9. Bugbot is set up for automated code reviews on this repo. Configure here.