test: fix flaky ContentDrafts listHint assertion#83
Merged
Conversation
listHint renders only when filteredVariants.length > 0 (ContentDraftsPage.tsx:648), which happens after the variants adapter resolves. The test used sync getByText right after the page heading resolved — fast local machines hit the render window, but slower CI runners miss it (seen on PR #81's Unit Tests job). Switch to findByText so the test waits for the async list load. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 23, 2026
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.
What
Change the `getByText` assertion for `contentDrafts.listHint` in `ContentDraftsPage.test.tsx` to `findByText` so the test waits for the async variants fetch to resolve before checking for the hint.
Why
`ContentDraftsPage.tsx:648` renders the listHint only when `filteredVariants.length > 0`. The list comes from an async adapter (mocked in the test), so the hint appears a tick after the heading resolves. The sync `getByText` call immediately after `findByRole('heading', ...)` hit the render window on fast local machines but missed it on slower CI runners — flaked on PR #81's Unit Tests job (run) while passing 5/5 locally. Not caused by #81; just surfaced there now that release/** PRs run the full test matrix.
Test plan
Target branch
`release/0.3.0` — unblocks #81 and any future rc stabilization PR that would otherwise hit this flake.
🤖 Generated with Claude Code