Skip to content

test(embed): stop closing the born-open session card before clicking into it - #676

Merged
omridevk merged 2 commits into
mainfrom
flake-embed-element-capture-click
Nov 1, 2026
Merged

omridevk merged 2 commits into
mainfrom
flake-embed-element-capture-click

Conversation

@omridevk

@omridevk omridevk commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

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 pipeline timed 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.tsx renders ToolCard with autoOpen true, and thread.tsx only 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-expanded true), which is the state the following steps depend on. No sleeps, no polls, no timeout change, no product code, no changeset.

Verification

  • Chromium CPU throttled 8x through CDP in a temporary copy of the test: old test fails 10 of 10 with the exact CI signature, new test passes 10 of 10. Unthrottled: 10 of 10 both ways.
  • 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

omridevk and others added 2 commits November 1, 2026 02:24
…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>
Copilot AI balanced review requested due to automatic review settings November 1, 2026 00:25
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 84407fab-ad72-4dbe-bcfc-c8a542fc86a1
Commits

Reviewing files that changed from the base of the PR and between 15c2fcb and 4c36827.

Files selected for processing: 1
  • packages/embed/tests/e2e/embed.it.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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-expanded is true.
  • 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

@omridevk
omridevk merged commit 1f03f06 into main Nov 1, 2026
46 of 48 checks passed
@omridevk
omridevk deleted the flake-embed-element-capture-click branch November 1, 2026 00:45
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