Skip to content

test(ContextMenu): the nested bottom-sheet case waits for its first row - #7761

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:context-menu-test-sheet-order
Oct 21, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:context-menu-test-sheet-order

Conversation

@vjeux

@vjeux vjeux commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

ContextMenu.test.tsx's "drills into nested data items inside the BottomSheet" fails when it runs alone (vitest run ContextMenu.test.tsx -t "drills into nested"), on main too. In the full file it passes only because an earlier sheet case has already rendered ContextMenu's sheet.

Intended invariant

Each sheet case passes on its own, whatever ran before it. ContextMenu's touch sheet is React.lazy, so its first render suspends once even when the module is already loaded (as #7758's warm-up ensures). A case must wait for the sheet's first row instead of querying it in the same tick as the open.

Change

The case awaits its first row with findByRole before clicking it. The case and its assertions are otherwise unchanged. The other two sheet cases already wait for the sheet through waitFor and pass alone. Test file only: no source, story or record change, so no changeset.

Evidence

  • Failure before the change: 20 isolated copies of main's suite, each running only this case: 20 of 20 fail ("Unable to find an accessible element with the role "button" and name "Move to project"").
  • Success after the change: the same 20 copies of this branch's suite pass 20 of 20.
  • Product/runtime behavior verified unchanged: only the test file changes; the ContextMenu, DropdownMenu and MoreMenu suites pass.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

20 copies, each:  pnpm exec vitest run packages/core/src/ContextMenu/ContextMenu.solo<N>.test.tsx -t "drills into nested data items inside the BottomSheet"
  main (25548b9e71):   20 files, 20 failed
  this branch:         20 files, 20 passed

Each sheet case alone on main:
  "opens the real menu content in a BottomSheet when requested"        passed
  "drills into nested data items inside the BottomSheet"               failed
  "uses the BottomSheet for adaptive presentation on compact touch"    passed

pnpm exec vitest run packages/core/src/ContextMenu packages/core/src/DropdownMenu packages/core/src/MoreMenu   Tests 385 passed
pnpm -F @astryxdesign/core typecheck, pnpm lint:strict, pnpm check:knowledge, pnpm storybook:build   ✓

ContextMenu's touch sheet is React.lazy, so its first render suspends once even when the module is already loaded. 'drills into nested data items inside the BottomSheet' queried its first row synchronously and passed only after an earlier case had rendered a sheet; run alone it failed. It now awaits the row with findByRole.
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 20, 2026 8:50pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 20, 2026
@astracat-bot

astracat-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 20, 2026, 9:06 PM UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

ContextMenu (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 630 -
Complexity N/A Very High (79) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot 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.

This looks ready to merge. Awaiting the first sheet row with findByRole lets "drills into nested data items inside the BottomSheet" pass on its own, and the case still fails if ContextMenu's sheet never renders that row. Run alone, the case fails on main and passes on this branch, and the ContextMenu, DropdownMenu and MoreMenu suites stay green. No changes are needed.

[Automated review]

@cixzhang
cixzhang merged commit ecb0468 into meta:main Oct 21, 2026
48 checks passed
@vjeux
vjeux deleted the context-menu-test-sheet-order branch October 21, 2026 14:31

This branch was successfully deployed

1 active deployment
Preview — f6706919 Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants