Skip to content

test(storybook): wait for context menu to settle - #4889

Merged
Astro-Han merged 1 commit into
apache:mainfrom
liugddx:fix/storybook-context-menu-visibility
Sep 6, 2026
Merged

test(storybook): wait for context menu to settle#4889
Astro-Han merged 1 commit into
apache:mainfrom
liugddx:fix/storybook-context-menu-visibility

Conversation

@liugddx

@liugddx liugddx commented Sep 6, 2026

Copy link
Copy Markdown
Member

Problem

The Storybook smoke test for switching from an existing session to a new task intermittently asserted that the context menu was visible during its asynchronous loading-catalog update. Hosted smoke failed at menu.toBeVisible() while the menu was between renders.

Fix

Wait for the menu to settle before asserting it remains visible after clicking the loading Skills row. The story behavior and production Composer code are unchanged.

Validation

AI use

Generative tooling contributed substantively to this patch. The commit carries Generated-by: OpenAI Codex.

The loading-catalog context menu updates asynchronously when switching from an existing session to a new task. Wait up to five seconds for the menu to remain visible after activating the loading Skills row, avoiding a race in the Storybook smoke assertion.

Generated-by: OpenAI Codex
@liugddx
liugddx force-pushed the fix/storybook-context-menu-visibility branch from 783babc to 92c7a46 Compare September 6, 2026 03:55
@Astro-Han
Astro-Han merged commit a5a99a6 into apache:main Sep 6, 2026
1 check passed
Astro-Han pushed a commit that referenced this pull request Sep 6, 2026
The Storybook smoke intermittently read the composer's + menu as hidden right after it opened: jest-dom's `toBeVisible` reads the Astryx layer's computed `opacity`, and the layer's entry keyframes use `animation-fill-mode: backwards`, so the value is `0` until the first frame ticks. On a loaded runner the assertion landed inside that window, and `main` failed on `plus-menu-during-skill-refresh` (run 34017497207). #4889 already wrapped the same read in the slash-menu story; this wraps the app-shell sibling and the two `findByRole('listbox')` reads after it in the same `waitFor`.

The app-shell harness also held its Skill refresh on a 150ms timer, which a slow runner outlived before the story clicked the row, so the click activated the row for real and closed the menu. The harness now settles on an explicit release the story calls after the busy-row assertions. Story-only change; no product code touched.

Generated-by: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XS Under 10 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants