[No QA] fix: flaky test SubscriptionUtils#59279
Conversation
|
@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] |
mountiny
left a comment
There was a problem hiding this comment.
Are there no other places this change needs to be added? @nkdengineer
|
@nkdengineer There are a few places on tests/ where we use new Date, along with many others. Do you think this change is necessary here? App/tests/unit/DateUtilsTest.ts Line 127 in 9eb1310 App/tests/unit/DateUtilsTest.ts Line 136 in 9eb1310 App/tests/ui/PaginationTest.tsx Line 41 in 9eb1310 App/tests/ui/UnreadIndicatorsTest.tsx Line 106 in 9eb1310 App/tests/actions/ReportTest.ts Line 836 in 9eb1310 |
|
@jayeshmangwani These tests have already used the fake time. We don't need the change this. |
|
@nkdengineer Okay, cool. Are you saying all the other tests have the correct date mocked, and we only need to change it in this getEarlyDiscountInfo only? |
|
Yes. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.1.22-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.1.22-10 🚀
|
Explanation of Change
The flaky test due to
new Date()can return a different value in two places so we need to make sure it's the same value in the test.Fixed Issues
$ #59255
PROPOSAL:
Tests
getEarlyDiscountInfotest is passedOffline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop