Skip to content

Commit 2a1697f

Browse files
committed
update test
1 parent b9f031d commit 2a1697f

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

tests/unit/ReportSecondaryActionUtilsTest.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,39 @@ describe('getSecondaryAction', () => {
13021302
expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.HOLD)).toBe(true);
13031303
});
13041304

1305+
it('does not include HOLD option for submitter after first approval', () => {
1306+
const report = {
1307+
reportID: REPORT_ID,
1308+
type: CONST.REPORT.TYPE.EXPENSE,
1309+
ownerAccountID: EMPLOYEE_ACCOUNT_ID,
1310+
stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
1311+
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
1312+
} as unknown as Report;
1313+
1314+
const transaction = {
1315+
transactionID: 'TRANSACTION_ID_R14932',
1316+
comment: {},
1317+
} as unknown as Transaction;
1318+
const policy = {} as unknown as Policy;
1319+
1320+
jest.spyOn(ReportUtils, 'canHoldUnholdReportAction').mockReturnValueOnce({canHoldRequest: true, canUnholdRequest: true});
1321+
jest.spyOn(ReportUtils, 'isAwaitingFirstLevelApproval').mockReturnValueOnce(false);
1322+
jest.spyOn(ReportActionsUtils, 'getOneTransactionThreadReportID').mockReturnValueOnce(originalMessageR14932.IOUTransactionID);
1323+
const result = getSecondaryReportActions({
1324+
currentUserLogin: EMPLOYEE_EMAIL,
1325+
currentUserAccountID: EMPLOYEE_ACCOUNT_ID,
1326+
report,
1327+
chatReport,
1328+
reportTransactions: [transaction],
1329+
originalTransaction: {} as Transaction,
1330+
violations: {},
1331+
bankAccountList: {},
1332+
policy,
1333+
reportActions: [actionR14932],
1334+
});
1335+
expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.HOLD)).toBe(false);
1336+
});
1337+
13051338
it('does not include CHANGE_WORKSPACE option for submitted IOU report and manager being the payer of the new policy', async () => {
13061339
const report = {
13071340
reportID: REPORT_ID,

0 commit comments

Comments
 (0)