Skip to content

Commit c698f74

Browse files
committed
test case - includes DELETE option for invoice report submitter when total is zero
1 parent 12f7da3 commit c698f74

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/unit/ReportSecondaryActionUtilsTest.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,26 @@ describe('getSecondaryAction', () => {
795795
expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.DELETE)).toBe(true);
796796
});
797797

798+
it('includes DELETE option for invoice report submitter when total is zero', async () => {
799+
const report = {
800+
reportID: REPORT_ID,
801+
type: CONST.REPORT.TYPE.INVOICE,
802+
ownerAccountID: EMPLOYEE_ACCOUNT_ID,
803+
statusNum: CONST.REPORT.STATUS_NUM.OPEN,
804+
stateNum: CONST.REPORT.STATE_NUM.OPEN,
805+
total: 0,
806+
} as unknown as Report;
807+
808+
const policy = {
809+
role: CONST.POLICY.ROLE.USER,
810+
} as unknown as Policy;
811+
812+
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);
813+
814+
const result = getSecondaryTransactionThreadActions(report, {} as Transaction, [], policy);
815+
expect(result.includes(CONST.REPORT.SECONDARY_ACTIONS.DELETE)).toBe(true);
816+
});
817+
798818
it('includes DELETE option for owner of unreported transaction', () => {
799819
const report = {
800820
reportID: REPORT_ID,

0 commit comments

Comments
 (0)