Repository navigation
test(embed): stop closing the born-open session card before clicking into it - #676
Conversation
…on card The page session card is born open while its message is the last one (autoOpen, folded only once a later message exists), so the test's click on the card header toggled it closed. The step text and the Script trigger stayed hittable only during the 200ms collapse, so the Script click raced the animation and, once the card finished closing, timed out on an invisible target. Assert the card is expanded instead of clicking it, the same fix #597 applied to the session-card stories. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 58 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the test change that asserts the session card’s default-open state without toggling it.
No open issues 🎉
What changed in this PR
Fixes an embed integration-test race by respecting the session card’s default-open behavior introduced in #597, rather than accidentally closing it before interacting with its contents.
Changes:
- Replaces the session-card click with an assertion that
aria-expandedistrue. - Leaves product code, timeouts, and subsequent interaction checks unchanged.
| File | Description |
|---|---|
packages/embed/tests/e2e/embed.it.test.ts |
Asserts the session card is open without toggling it closed. |
Review effort: Balanced
Why
embed.it.test.ts > element capture > renders a page verb run through real code mode as one aggregated session card fed by the capture pipelinetimed out on CI shard 1 (PR #666, 180s clicking the Script trigger, 343 retries, "intercepts pointer events" on a closing collapsible). The embed cut agent hit it once in two local runs too.Mechanism
The test's own click. Since #597 the session card is born open (
session-card.tsxrendersToolCardwithautoOpentrue, andthread.tsxonly folds a card once its message is no longer the last one). The test then clicked the card to "open" it, which closed it. The card collapses over 200ms, and the next step, clicking the Script section inside it, only landed if it arrived inside that window. On a loaded CI runner it arrived mid-collapse (the closing content covers the trigger), then after it (not visible), until the timeout. #597 fixed the same mistake in the session-card stories; this test was missed.What changed
One line: the click is replaced by asserting the card is open (
aria-expandedtrue), which is the state the following steps depend on. No sleeps, no polls, no timeout change, no product code, no changeset.Verification
TURBO_CONCURRENCY=1 VITEST_MAX_FORKS=1 turbo run test --filter=@conciv/embed, typecheck, lint, format, fallow, changeset coverage pass.A user who clicks a just-finished session card also closes it. That matches the #597 design; flagging only in case it should not.
🤖 Generated with Claude Code