[No QA] test: fix IOURequestStepConfirmationPageTest failures#83379
Merged
Conversation
…orts The test was broken by three issues: 1. IntlStore and emoji locale modules use dynamic import() which fails in Jest without --experimental-vm-modules. Mock IntlStore to synchronously load English translations via require(), mock importEmojiLocale to no-op, and mock buildEmojisTrie to avoid iterating unmocked emoji data. 2. Missing Onyx.clear() in afterEach allowed state to leak between tests, causing intermittent failures depending on test execution order. 3. The "should not zero out tax" test used non-policy-expense-chat participants, so shouldShowTax was false and the tax calculation useEffects in MoneyRequestConfirmationList never ran. Updated participants to use isPolicyExpenseChat: true with a proper policy chat report, matching the pattern in other passing tax tests. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@chiragsalian 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] |
54 tasks
Contributor
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
Contributor
|
🚀 Deployed to staging by https://github.com/chiragsalian in version: 9.3.26-0 🚀
|
Contributor
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.3.26-8 🚀
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
IOURequestStepConfirmationPageTesthas been failing consistently onmainand across PRs due to three issues:Dynamic
import()incompatibility with Jest —IntlStoreand the emoji locale system use dynamicimport()calls that fail in Jest without--experimental-vm-modules. This caused all 13 tests to throwTypeError: A dynamic import callback was invoked without --experimental-vm-modules. Fixed by mockingIntlStoreto synchronously load English translations viarequire(), mockingimportEmojiLocaleto no-op, and mockingbuildEmojisTrieto avoid iterating unmocked emoji data.Missing
Onyx.clear()inafterEach— Unlike other UI tests, this file had no Onyx cleanup between tests, allowing state to leak and cause order-dependent failures.Wrong participant type in tax test — The "should not zero out tax when re-selecting distance rate without reclaimable configured" test used
{accountID: ..., selected: true}participants instead of{isPolicyExpenseChat: true, ...}. This meantshouldShowTaxwasfalseinMoneyRequestConfirmationList, so the tax calculationuseEffects never ran. Updated to match the pattern used by the other passing tax tests.Fixed Issues
N/A — test-only fix, no linked issue.
Tests
npx jest tests/ui/components/IOURequestStepConfirmationPageTest.tsx --no-coverage --verboseOffline tests
N/A — test-only change.
QA Steps
// [No QA] — this is a test-only fix with no product behavior 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
Made with Cursor