Skip to content

test: fix flaky ContentDrafts listHint assertion#83

Merged
webup merged 1 commit into
release/0.3.0from
fix/flaky-content-drafts-test
Apr 23, 2026
Merged

test: fix flaky ContentDrafts listHint assertion#83
webup merged 1 commit into
release/0.3.0from
fix/flaky-content-drafts-test

Conversation

@webup
Copy link
Copy Markdown
Contributor

@webup webup commented Apr 23, 2026

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

  • 5/5 consecutive local runs pass with the fix
  • Fix is 1 character: `getByText` → `findByText`, no behavior change

Target branch

`release/0.3.0` — unblocks #81 and any future rc stabilization PR that would otherwise hit this flake.

🤖 Generated with Claude Code

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>
@webup webup merged commit fa90e2d into release/0.3.0 Apr 23, 2026
13 checks passed
@webup webup deleted the fix/flaky-content-drafts-test branch April 23, 2026 10:20
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