Skip to content

Commit 75f772b

Browse files
committed
update UTs
1 parent 6488bad commit 75f772b

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

src/pages/ReportDetailsPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@ function ReportDetailsPage({policy, report, route, reportMetadata}: ReportDetail
581581
isRestrictedToPreferredPolicy,
582582
preferredPolicyID,
583583
introSelected,
584+
parentReport,
584585
]);
585586

586587
const displayNamesWithTooltips = useMemo(() => {
@@ -868,6 +869,7 @@ function ReportDetailsPage({policy, report, route, reportMetadata}: ReportDetail
868869
isChatIOUReportArchived,
869870
hasOutstandingChildTask,
870871
parentReportAction,
872+
parentReport,
871873
]);
872874

873875
// Where to navigate back to after deleting the transaction and its report.

src/pages/home/report/ReportFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ function ReportFooter({
177177
});
178178
return true;
179179
},
180-
[allPersonalDetails, ancestors, availableLoginsList, currentUserEmail, personalDetail.accountID, quickAction, report.policyID, report.reportID],
180+
[allPersonalDetails, ancestors, availableLoginsList, currentUserEmail, personalDetail.accountID, quickAction, report],
181181
);
182182

183183
const [targetReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID ?? report.reportID}`, {canBeMissing: true});

src/pages/tasks/TaskAssigneeSelectorModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function TaskAssigneeSelectorModal() {
202202
});
203203
}
204204
},
205-
[report, currentUserPersonalDetails.accountID, task?.shareDestination, backTo, hasOutstandingChildTask, allPersonalDetails],
205+
[report, currentUserPersonalDetails.accountID, task?.shareDestination, backTo, hasOutstandingChildTask, allPersonalDetails, parentReport],
206206
);
207207

208208
const handleBackButtonPress = useCallback(() => Navigation.goBack(!route.params?.reportID ? ROUTES.NEW_TASK.getRoute(backTo) : backTo), [route.params, backTo]);

tests/actions/TaskTest.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ describe('actions/Task', () => {
370370

371371
// When: Call createTaskAndNavigate
372372
createTaskAndNavigate({
373-
parentReportID: mockParentReportID,
373+
parentReport: {reportID: mockParentReportID},
374374
title: mockTitle,
375375
description: mockDescription,
376376
assigneeEmail: mockAssigneeEmail,
@@ -416,7 +416,7 @@ describe('actions/Task', () => {
416416

417417
// When: Call createTaskAndNavigate without assignee chat report
418418
createTaskAndNavigate({
419-
parentReportID: mockParentReportID,
419+
parentReport: {reportID: mockParentReportID},
420420
title: mockTitle,
421421
description: mockDescription,
422422
assigneeEmail: mockAssigneeEmail,
@@ -476,7 +476,7 @@ describe('actions/Task', () => {
476476

477477
// When: Call createTaskAndNavigate with markdown flag
478478
createTaskAndNavigate({
479-
parentReportID: mockParentReportID,
479+
parentReport: {reportID: mockParentReportID},
480480
title: mockTitle,
481481
description: mockDescription,
482482
assigneeEmail: mockAssigneeEmail,
@@ -514,7 +514,7 @@ describe('actions/Task', () => {
514514

515515
// When: Call createTaskAndNavigate with default policy ID
516516
createTaskAndNavigate({
517-
parentReportID: mockParentReportID,
517+
parentReport: {reportID: mockParentReportID},
518518
title: mockTitle,
519519
description: mockDescription,
520520
assigneeEmail: mockAssigneeEmail,
@@ -559,7 +559,7 @@ describe('actions/Task', () => {
559559

560560
// When: Call createTaskAndNavigate with assignee as current user
561561
createTaskAndNavigate({
562-
parentReportID: mockParentReportID,
562+
parentReport: {reportID: mockParentReportID},
563563
title: mockTitle,
564564
description: mockDescription,
565565
assigneeEmail: mockCurrentUserEmail,
@@ -614,7 +614,7 @@ describe('actions/Task', () => {
614614

615615
// When: Call createTaskAndNavigate with undefined parent report ID
616616
createTaskAndNavigate({
617-
parentReportID: undefined, // parentReportID is undefined
617+
parentReport: undefined,
618618
title: mockTitle,
619619
description: mockDescription,
620620
assigneeEmail: mockAssigneeEmail,
@@ -649,7 +649,7 @@ describe('actions/Task', () => {
649649

650650
// When: Call createTaskAndNavigate with empty quick action
651651
createTaskAndNavigate({
652-
parentReportID: mockParentReportID,
652+
parentReport: {reportID: mockParentReportID},
653653
title: mockTitle,
654654
description: mockDescription,
655655
assigneeEmail: mockAssigneeEmail,
@@ -744,7 +744,7 @@ describe('actions/Task', () => {
744744
await waitForBatchedUpdatesWithAct();
745745

746746
// When: Call completeTask
747-
completeTask(taskReport, false, parentReportAction);
747+
completeTask(taskReport, false, false, parentReportAction);
748748

749749
await waitForBatchedUpdatesWithAct();
750750

@@ -810,7 +810,7 @@ describe('actions/Task', () => {
810810
await waitForBatchedUpdatesWithAct();
811811

812812
// When: Call completeTask
813-
completeTask(taskReport, false, undefined);
813+
completeTask(taskReport, false, false, undefined);
814814

815815
await waitForBatchedUpdatesWithAct();
816816

0 commit comments

Comments
 (0)