[No QA] Fix flaky useSelectedTransactionsActions tests - #81464
Conversation
Tests were waiting for options.length > 0, which is satisfied by the EXPORT option that appears immediately. However, SPLIT/MOVE/MERGE options depend on selectedTransactionsList which requires Onyx data to be fully loaded. Fixed by waiting for the specific option inside waitFor instead of just checking options.length. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@jayeshmangwani Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@sobitneupane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
I think this is a test-only change we don't need C+ review here |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.3.13-1 🚀
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.3.15-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.15-10 🚀
|
Explanation of Change
Fixed flaky tests in
useSelectedTransactionsActions.test.ts. The tests were waiting foroptions.length > 0, which is satisfied immediately when the EXPORT option appears. However, SPLIT/MOVE/MERGE options depend onselectedTransactionsListwhich is derived fromallTransactionsloaded asynchronously viauseOnyx. The fix moves the specific option assertion insidewaitForto ensure the test waits until Onyx data is fully loaded.Ran the tests 35 times after the fix with 0 failures.
Fixed Issues
$ #81459
Tests
Offline tests
N/A - Test-only change
QA Steps
N/A - No QA needed for test-only changes
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A - Test-only change
Android: mWeb Chrome
N/A - Test-only change
iOS: Native
N/A - Test-only change
iOS: mWeb Safari
N/A - Test-only change
MacOS: Chrome / Safari
N/A - Test-only change