[NO QA] migrate group 5 tests to ts#37482
Conversation
1b59669 to
f9dd242
Compare
73ad1c1 to
e0813e4
Compare
|
|
||
| type ReportActions = Record<string, ReportAction>; | ||
|
|
||
| type ReportActionCollectionDataSet = CollectionDataSet<typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS>; |
There was a problem hiding this comment.
What about using this approach? Other PRs are doing.
There was a problem hiding this comment.
Do we already have this helper?
| value: { | ||
| 1: REPORT_ACTION, | ||
| }, | ||
| shouldNotify: true, |
There was a problem hiding this comment.
reverted with the comment as it was done in another test
| [`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}4`]: null, | ||
| }; | ||
|
|
||
| // @ts-expect-error preset null values |
There was a problem hiding this comment.
If it's possible to set null values maybe we can update CollectionDataSet type to include null:
type CollectionDataSet<TCollectionKey extends OnyxCollectionKey> = Record<`${TCollectionKey}${string}`, OnyxEntry<OnyxCollectionValuesMapping[TCollectionKey]>>;
After that you can type setQueries var using CollectionDataSet type and get rid of this comment. What do you think?
There was a problem hiding this comment.
there is a problem not only with a type.
In this case, we need to specify the key in onyx, since toCollectionDataSet we can set it only from the object data by passing the selector (in this case we will select from the )
I think the current approach is simpler for test purposes
There was a problem hiding this comment.
I mean if you update CollectionDataSet type as I mentioned above, you can then type it like
const setQueries: CollectionDataSet<typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS> = {
[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}1`]: null,
[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}2`]: {},
[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}3`]: {},
[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}4`]: null,
};
No need to use toCollectionDataSet in this case, and you will not have TS error. You can even create a separate type for CollectionDataSet<typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS> as you did here.
But it's up to you
|
@aimane-chnaif 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] |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25327 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
@bondydaa looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
lies, they had all passed. |
|
🚀 Deployed to staging by https://github.com/bondydaa in version: 1.4.56-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.56-8 🚀
|
Details
Fixed Issues
$ #25327
#25326
#25325
#25328
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.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.- [x] If a new page is added, I verified it's using theScrollViewcomponent 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