-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[No QA][TS migration] Migrate 'ReportActionsUtilsTest.js' test to TypeScript #36482
[No QA][TS migration] Migrate 'ReportActionsUtilsTest.js' test to TypeScript #36482
Conversation
b0851f4
to
45d4052
Compare
@@ -511,7 +511,7 @@ function filterOutDeprecatedReportActions(reportActions: ReportActions | null): | |||
* to ensure they will always be displayed in the same order (in case multiple actions have the same timestamp). | |||
* This is all handled with getSortedReportActions() which is used by several other methods to keep the code DRY. | |||
*/ | |||
function getSortedReportActionsForDisplay(reportActions: ReportActions | null, shouldMarkTheFirstItemAsNewest = false): ReportAction[] { | |||
function getSortedReportActionsForDisplay(reportActions: ReportActions | ReportAction[] | null, shouldMarkTheFirstItemAsNewest = false): ReportAction[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this function work when we pass an array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we changing it because of test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if yest I would adjust tests to pass correct types instead of changing a type here @fabioh8010 WYDT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it works as expected with array (no diff between arrays and objects, since we are still dealing with key values pairs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a change to unit tests so doesn't require C+ review.
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25281 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
tests/unit/ReportActionsUtilsTest.ts
Outdated
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`, | ||
key: 'reportActions_test', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change, to signal it's a test since the key doesn't really matter here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was changed to pass the ts check since with the template string it is not recognizable as a valid key for Onyx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pasyukevich I just checked out your PR here, and it's working fine with ${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}
, could you re-check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabioh8010 reverted
after changes in pr this update became redundant
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: DesktopNote: checklist was filled out for GH action to succeed, but not completed since this just changes a test file |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/cead22 in version: 1.4.44-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.44-13 🚀
|
Details
Fixed Issues
$ #25281
PROPOSAL:
Tests
Run unit tests and check that it finished successfully
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop