Skip to content

Commit 0240661

Browse files
committed
update code
1 parent 4df272e commit 0240661

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

src/pages/home/report/PureReportActionItem.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ type PureReportActionItemProps = {
342342
reportAction: OnyxEntry<OnyxTypes.ReportAction>,
343343
resolution: ValueOf<typeof CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION>,
344344
formatPhoneNumber: LocaleContextProps['formatPhoneNumber'],
345-
policy: OnyxEntry<OnyxTypes.Policy>,
346345
isReportArchived: boolean,
346+
policy: OnyxEntry<OnyxTypes.Policy>,
347347
) => void;
348348

349349
/** Whether the provided report is a closed expense report with no expenses */
@@ -908,8 +908,8 @@ function PureReportActionItem({
908908
action,
909909
CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE_TO_SUBMIT_EXPENSE,
910910
formatPhoneNumber,
911-
policy,
912911
isOriginalReportArchived,
912+
policy,
913913
),
914914
isMediumSized: true,
915915
});
@@ -925,8 +925,8 @@ function PureReportActionItem({
925925
action,
926926
CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE,
927927
formatPhoneNumber,
928-
policy,
929928
isOriginalReportArchived,
929+
policy,
930930
),
931931
isMediumSized: true,
932932
},
@@ -939,8 +939,8 @@ function PureReportActionItem({
939939
action,
940940
CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.NOTHING,
941941
formatPhoneNumber,
942-
policy,
943942
isOriginalReportArchived,
943+
policy,
944944
),
945945
isMediumSized: true,
946946
},

tests/unit/SidebarUtilsTest.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ describe('SidebarUtils', () => {
351351
localeCompare,
352352
lastAction: undefined,
353353
lastActionReport: undefined,
354+
isReportArchived: undefined,
354355
});
355356
const optionDataUnpinned = SidebarUtils.getOptionData({
356357
report: MOCK_REPORT_UNPINNED,
@@ -364,6 +365,7 @@ describe('SidebarUtils', () => {
364365
localeCompare,
365366
lastAction: undefined,
366367
lastActionReport: undefined,
368+
isReportArchived: undefined,
367369
});
368370

369371
expect(optionDataPinned?.isPinned).toBe(true);
@@ -896,6 +898,7 @@ describe('SidebarUtils', () => {
896898
localeCompare,
897899
lastAction,
898900
lastActionReport: undefined,
901+
isReportArchived: undefined,
899902
});
900903

901904
// Then the alternate text should be equal to the message of the last action prepended with the last actor display name.
@@ -959,6 +962,7 @@ describe('SidebarUtils', () => {
959962
localeCompare,
960963
lastAction,
961964
lastActionReport: undefined,
965+
isReportArchived: undefined,
962966
});
963967

964968
// Then the alternate text should show @Hidden.
@@ -1007,6 +1011,7 @@ describe('SidebarUtils', () => {
10071011
lastAction: undefined,
10081012
localeCompare,
10091013
lastActionReport: undefined,
1014+
isReportArchived: undefined,
10101015
});
10111016

10121017
expect(optionData?.alternateText).toBe(`test message`);
@@ -1083,6 +1088,7 @@ describe('SidebarUtils', () => {
10831088
lastAction: undefined,
10841089
localeCompare,
10851090
lastActionReport: undefined,
1091+
isReportArchived: undefined,
10861092
});
10871093

10881094
expect(optionData?.alternateText).toBe(`test message`);
@@ -1208,6 +1214,7 @@ describe('SidebarUtils', () => {
12081214
lastAction: undefined,
12091215
localeCompare,
12101216
lastActionReport: undefined,
1217+
isReportArchived: undefined,
12111218
});
12121219

12131220
expect(optionData?.alternateText).toBe(formatReportLastMessageText(iouReport.reportName));
@@ -1249,6 +1256,7 @@ describe('SidebarUtils', () => {
12491256
lastAction: undefined,
12501257
localeCompare,
12511258
lastActionReport: undefined,
1259+
isReportArchived: undefined,
12521260
});
12531261

12541262
expect(optionData?.alternateText).toBe(`${policy.name} ${CONST.DOT_SEPARATOR} test message`);
@@ -1319,6 +1327,7 @@ describe('SidebarUtils', () => {
13191327
localeCompare,
13201328
lastAction,
13211329
lastActionReport: undefined,
1330+
isReportArchived: undefined,
13221331
});
13231332

13241333
// Then the alternate text should be equal to the message of the last action prepended with the last actor display name.
@@ -1378,6 +1387,7 @@ describe('SidebarUtils', () => {
13781387
localeCompare,
13791388
lastAction,
13801389
lastActionReport: undefined,
1390+
isReportArchived: undefined,
13811391
});
13821392

13831393
expect(result?.alternateText).toBe(`You: moved this report to the Three's Workspace workspace`);
@@ -1449,6 +1459,7 @@ describe('SidebarUtils', () => {
14491459
localeCompare,
14501460
lastAction,
14511461
lastActionReport: undefined,
1462+
isReportArchived: undefined,
14521463
});
14531464

14541465
expect(result?.alternateText).toBe(`You: ${getReportActionMessageText(lastAction)}`);
@@ -1565,6 +1576,7 @@ describe('SidebarUtils', () => {
15651576
localeCompare,
15661577
lastAction,
15671578
lastActionReport: undefined,
1579+
isReportArchived: undefined,
15681580
});
15691581

15701582
expect(result?.alternateText).toContain(`${getReportActionMessageText(lastAction)}`);
@@ -1648,6 +1660,7 @@ describe('SidebarUtils', () => {
16481660
localeCompare,
16491661
lastAction,
16501662
lastActionReport: undefined,
1663+
isReportArchived: undefined,
16511664
});
16521665

16531666
expect(result?.alternateText).toBe(`One: submitted`);

0 commit comments

Comments
 (0)