-
Notifications
You must be signed in to change notification settings - Fork 3k
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 '[Remaining]' test to TypeScript #36867
Conversation
@mananjadhav 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] |
@mananjadhav PR is ready but I'm having some typescript issues that I couldn't address by myself and I need your help. Could you please check them when you get the chance. Thanks. |
@HezekielT Can you please merge with the latest main? I just reviewed your questions, but I've asked for help here from agency members who've setup TS in react-native-onyx. |
Thanks @ishpaul777. @HezekielT I hope we have queries answered. Can you please push the further changes? |
@@ -20,25 +21,27 @@ describe('actions/Policy', () => { | |||
}); | |||
|
|||
beforeEach(() => { | |||
// @ts-expect-error TODO: Remove this once TestHelper (https://github.com/Expensify/App/issues/25318) is migrated to TypeScript. |
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.
Don't put TODOs in the code. If we have an issue, that's already good enough
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.
I included the TODO part because of the guidelines
Suppress a TypeScript error stemming from the bug with @ts-expect-error. Create a separate GH issue. Prefix the issue title with [TS ERROR #]. Cross-link the migration PR and the created GH issue. On the same line as @ts-expect-error, put down the GH issue number prefixed with TODO:.
The @ts-expect-error annotation tells the TS compiler to ignore any errors in the line that follows it. However, if there's no error in the line, TypeScript will also raise an error.
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.
@hayata-suenaga any reason we need TODOs in the code, or are GH issues sufficient? I ask cause we normally don't put TODOs in code (see SO), and this guideline is kinda contradicts that. In any case, @HezekielT don't block on this, and sorry for the confusion
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.
@cead22 We were at a point where every issue was blocked by some other and without @ts-expect-error
we would be stuck or move very slowly. That's why we decided to allow TODOs in the codebase, the good part is that once TestHelper
gets migrated here, this line will throw an error so these TODOs will disappear over time (once we migrate blocking files).
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.
thanks @blazejkustra for the explanation!
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.
Thanks for the context. I'm still curious, why do we need TODOs when we have GH issues? Don't the GH issues serve as TODOs? Could we link the lines of codes in the issues, instead of linking the issues in the code?
tests/actions/PolicyTest.ts
Outdated
import * as Policy from '../../src/libs/actions/Policy'; | ||
import ONYXKEYS from '../../src/ONYXKEYS'; | ||
import OnyxUpdateManager from '@src/libs/actions/OnyxUpdateManager'; | ||
import * as POLICY from '@src/libs/actions/Policy'; |
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.
import * as POLICY from '@src/libs/actions/Policy'; | |
import * as Policy from '@src/libs/actions/Policy'; |
@mananjadhav PR is ready for your review. |
Thanks for the updates. I'll review this today. |
I couldn't complete this yesterday. I am in the middle of the review, hoping to close this today. |
@@ -51,7 +57,7 @@ const mutlipleSectionsConfig = [ | |||
{numItems: 1000, indexOffset: 0}, | |||
{numItems: 100, indexOffset: 70}, | |||
]; | |||
|
|||
// @ts-expect-error TODO: Remove this once OptionsSelector is migrated to TypeScript. |
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.
do we have any issue to track this @cead22 ? If not, should we be creating one?
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.
We have this one but it's closed #25125. Maybe we need a new one for src/components/OptionsSelector/index.android.js and src/components/OptionsSelector/index.js
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.
One minor comment on tracking the issue, rest looks good.
Reviewer Checklist
Screenshots/VideosAndroid: NativeNA Android: mWeb ChromeNA iOS: NativeNA iOS: mWeb SafariNA MacOS: Chrome / SafariNA MacOS: DesktopNA |
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.
One last request for changes. @mananjadhav can you re-review please?
Co-authored-by: Carlos Alvarez <[email protected]>
Will review this later today. |
✋ 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.55-0 🚀
|
🚀 Deployed to staging by https://github.com/cead22 in version: 1.4.55-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.55-3 🚀
|
Details
Migrates
tests/unit/ViolationUtilsTest.js
tests/unit/UserUtilsTest.js
tests/unit/PhoneNumberTest.js
tests/perf-test/SearchPage.perf-test.js
tests/perf-test/OptionsSelector.perf-test.js
tests/actions/PolicyTest.js
to Typescript.
Fixed Issues
$ #36135
PROPOSAL:
Tests
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