Repository navigation
CODAP-1695: wait for a closing attribute menu before reopening it - #2827
Conversation
Chakra's menu applies `visibility: hidden` when its close animation ends, even if the menu has been reopened in the meantime. Choosing a menu item or clicking elsewhere (e.g. Undo) closes the menu, so a test that reopens it within that ~0.1s animation leaves it open but invisible, and openAttributeMenu's visibility check times out. That is the table.spec.ts formula test failure on main, where the menu reads `opacity: 1; visibility: hidden; transform: none`. openAttributeMenu now waits for that attribute's menu to finish closing before clicking it. Some closed menus never get `visibility: hidden` and stay `visibility: visible` at `opacity: 0`, so either state counts as closed. With 4x CPU throttling and retries off, the formula test failed 20 of 20 runs before this change and passes 20 of 20 after; every spec that uses the helper passes. Also correct closeAttributeMenu's comment, which said the menu closes "on its own" for unknown reasons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed.
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. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #2827 +/- ##
===========================================
- Coverage 89.42% 76.30% -13.12%
===========================================
Files 872 872
Lines 50762 50762
Branches 12515 12941 +426
===========================================
- Hits 45394 38736 -6658
- Misses 5352 11989 +6637
- Partials 16 37 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the test-only attribute-menu synchronization change.
No open issues 🎉
What changed in this PR
This PR addresses the recurring table formula-test flake by synchronizing CODAP v3’s Cypress attribute-menu helper with Chakra’s closing animation. It changes test behavior only, not application behavior.
Changes:
- Waits for the selected attribute’s menu to finish closing before reopening it, accepting either hidden visibility or zero opacity.
- Corrects the
closeAttributeMenucomment to explain that menu actions and outside clicks can already have closed the menu.
| File | Description |
|---|---|
v3/cypress/support/elements/table-tile.ts |
Adds the closing-state wait and clarifies the existing close-helper comment. |
Review effort: Balanced
codap-v3
|
||||||||||||||||||||||||||||
| Project |
codap-v3
|
| Branch Review |
main
|
| Run status |
|
| Run duration | 02m 27s |
| Commit |
|
| Committer | github-actions[bot] |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
4
|
| View all changes introduced in this branch ↗︎ | |
Summary
Fixes the root cause of the flaky
table.spec.ts› "edits, re-randomizes, and deletes formulas" test, which failed again onmainafter #2825 (and before it, at074e413a1).Cause. Chakra's menu applies
visibility: hiddenwhen its close animation ends (its exit variant'stransitionEnd), even if the menu has been reopened in the meantime. Choosing a menu item, or clicking elsewhere such as the Undo button, closes the menu. A test that reopens it within that ~0.1s animation leaves it open (aria-expanded="true") but invisible, and it stays that way. The failing runs show exactly that state:opacity: 1; visibility: hidden; transform: none.Fix.
openAttributeMenunow waits for that attribute's menu to finish closing before clicking it. Some closed menus never getvisibility: hiddenand stayvisibility: visibleatopacity: 0, so either state counts as closed. A first attempt that waited for every attribute menu to be hidden broke 19 tests for that reason.closeAttributeMenu's comment is also corrected: the menu wasn't closing "on its own", the test's own clicks were closing it.How the earlier fixes made this possible
This is the third PR for this flake, and the first two are what made the cause findable:
closeAttributeMenuclose the menu only if it's still open. Investigating it showed, from the Cypress Cloud log, that the menu really was closed after the Undo step, which ruled out several theories and pointed at that part of the test.openAttributeMenufail as soon as a menu that opened doesn't become visible, instead of at some later step, and logged uncaught exceptions. That moved the failure to the exact reopen, put the menu's style in the error message, and showed that no exception was involved. The Cypress Cloud command log for that failure laid out the close-then-reopen sequence step by step.With the failure pinned to one call and the stuck style in hand, the mechanism could be read from Chakra's menu animation and then reproduced on demand.
Testing
openAttributeMenupasses locally with retries off:table,plugin,formula/formula-component,table-index,attribute-focus-restore.case-carduses its own helper and also passes.lint:buildpasses.Notes
🤖 Generated with Claude Code