diff --git a/tests/actions/IOUTest.js b/tests/actions/IOUTest.js index 18793e88d624..97c1bf35732f 100644 --- a/tests/actions/IOUTest.js +++ b/tests/actions/IOUTest.js @@ -83,7 +83,6 @@ describe('actions/IOU', () => { // They should be linked together expect(chatReport.participantAccountIDs).toEqual([CARLOS_ACCOUNT_ID]); expect(chatReport.iouReportID).toBe(iouReport.reportID); - expect(chatReport.hasOutstandingIOU).toBe(true); resolve(); }, @@ -206,7 +205,6 @@ describe('actions/IOU', () => { let chatReport = { reportID: 1234, type: CONST.REPORT.TYPE.CHAT, - hasOutstandingIOU: false, participantAccountIDs: [CARLOS_ACCOUNT_ID], }; const createdAction = { @@ -249,7 +247,6 @@ describe('actions/IOU', () => { // They should be linked together expect(chatReport.iouReportID).toBe(iouReportID); - expect(chatReport.hasOutstandingIOU).toBe(true); resolve(); }, @@ -370,7 +367,6 @@ describe('actions/IOU', () => { let chatReport = { reportID: chatReportID, type: CONST.REPORT.TYPE.CHAT, - hasOutstandingIOU: true, iouReportID, participantAccountIDs: [CARLOS_ACCOUNT_ID], }; @@ -581,7 +577,6 @@ describe('actions/IOU', () => { // They should be linked together expect(chatReport.participantAccountIDs).toEqual([CARLOS_ACCOUNT_ID]); expect(chatReport.iouReportID).toBe(iouReport.reportID); - expect(chatReport.hasOutstandingIOU).toBe(true); resolve(); }, @@ -815,7 +810,6 @@ describe('actions/IOU', () => { let carlosChatReport = { reportID: NumberUtils.rand64(), type: CONST.REPORT.TYPE.CHAT, - hasOutstandingIOU: false, participantAccountIDs: [CARLOS_ACCOUNT_ID], }; const carlosCreatedAction = { @@ -827,7 +821,6 @@ describe('actions/IOU', () => { let julesChatReport = { reportID: NumberUtils.rand64(), type: CONST.REPORT.TYPE.CHAT, - hasOutstandingIOU: true, iouReportID: julesIOUReportID, participantAccountIDs: [JULES_ACCOUNT_ID], }; @@ -985,16 +978,13 @@ describe('actions/IOU', () => { expect(groupChat.pendingFields).toStrictEqual({createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD}); // The 1:1 chat reports and the IOU reports should be linked together - expect(carlosChatReport.hasOutstandingIOU).toBe(true); expect(carlosChatReport.iouReportID).toBe(carlosIOUReport.reportID); expect(carlosIOUReport.chatReportID).toBe(carlosChatReport.reportID); expect(carlosIOUReport.notificationPreference).toBe(CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN); - expect(julesChatReport.hasOutstandingIOU).toBe(true); expect(julesChatReport.iouReportID).toBe(julesIOUReport.reportID); expect(julesIOUReport.chatReportID).toBe(julesChatReport.reportID); - expect(vitChatReport.hasOutstandingIOU).toBe(true); expect(vitChatReport.iouReportID).toBe(vitIOUReport.reportID); expect(vitIOUReport.chatReportID).toBe(vitChatReport.reportID); expect(carlosIOUReport.notificationPreference).toBe(CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN); @@ -1233,7 +1223,6 @@ describe('actions/IOU', () => { expect(chatReport).toBeTruthy(); expect(chatReport).toHaveProperty('reportID'); expect(chatReport).toHaveProperty('iouReportID'); - expect(chatReport.hasOutstandingIOU).toBe(true); iouReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU); expect(iouReport).toBeTruthy(); @@ -1313,7 +1302,6 @@ describe('actions/IOU', () => { chatReport = _.find(allReports, (r) => r.type === CONST.REPORT.TYPE.CHAT); iouReport = _.find(allReports, (r) => r.type === CONST.REPORT.TYPE.IOU); - expect(chatReport.hasOutstandingIOU).toBe(false); expect(chatReport.iouReportID).toBeFalsy(); // expect(iouReport.status).toBe(CONST.REPORT.STATUS.REIMBURSED); @@ -1364,7 +1352,6 @@ describe('actions/IOU', () => { chatReport = _.find(allReports, (r) => r.type === CONST.REPORT.TYPE.CHAT); iouReport = _.find(allReports, (r) => r.type === CONST.REPORT.TYPE.IOU); - expect(chatReport.hasOutstandingIOU).toBe(false); expect(chatReport.iouReportID).toBeFalsy(); // expect(iouReport.status).toBe(CONST.REPORT.STATUS.REIMBURSED); @@ -1925,7 +1912,6 @@ describe('actions/IOU', () => { expect(chatReport).toBeTruthy(); expect(chatReport).toHaveProperty('reportID'); expect(chatReport).toHaveProperty('iouReportID'); - expect(chatReport.hasOutstandingIOU).toBe(true); // Then one of them should be an IOU report with relevant properties iouReport = _.find(allReports, (report) => report.type === CONST.REPORT.TYPE.IOU); @@ -2492,7 +2478,6 @@ describe('actions/IOU', () => { expect(iouReport).toBeTruthy(); expect(iouReport).toHaveProperty('reportID'); expect(iouReport).toHaveProperty('chatReportID'); - expect(iouReport.hasOutstandingIOU).toBeTruthy(); expect(iouReport.total).toBe(30000); const ioupreview = ReportActionsUtils.getReportPreviewAction(chatReport.reportID, iouReport.reportID); @@ -2510,7 +2495,6 @@ describe('actions/IOU', () => { expect(iouReport).toBeTruthy(); expect(iouReport).toHaveProperty('reportID'); expect(iouReport).toHaveProperty('chatReportID'); - expect(iouReport.hasOutstandingIOU).toBeTruthy(); expect(iouReport.total).toBe(20000); // When we resume fetch @@ -2520,7 +2504,6 @@ describe('actions/IOU', () => { expect(iouReport).toBeTruthy(); expect(iouReport).toHaveProperty('reportID'); expect(iouReport).toHaveProperty('chatReportID'); - expect(iouReport.hasOutstandingIOU).toBeTruthy(); expect(iouReport.total).toBe(20000); }); diff --git a/tests/unit/OptionsListUtilsTest.js b/tests/unit/OptionsListUtilsTest.js index 2f4294e53c73..45ddf44b244a 100644 --- a/tests/unit/OptionsListUtilsTest.js +++ b/tests/unit/OptionsListUtilsTest.js @@ -99,7 +99,6 @@ describe('OptionsListUtils', () => { participantAccountIDs: [8], reportName: 'Mister Sinister', iouReportID: 100, - hasOutstandingIOU: true, type: CONST.REPORT.TYPE.CHAT, }, diff --git a/tests/unit/ReportUtilsTest.js b/tests/unit/ReportUtilsTest.js index e0c98b1793f1..d060adb4c072 100644 --- a/tests/unit/ReportUtilsTest.js +++ b/tests/unit/ReportUtilsTest.js @@ -254,7 +254,6 @@ describe('ReportUtils', () => { const report = { ...LHNTestUtils.getFakeReport(), ownerAccountID: undefined, - hasOutstandingIOU: true, }; expect(ReportUtils.requiresAttentionFromCurrentUser(report)).toBe(false); }); @@ -266,7 +265,6 @@ describe('ReportUtils', () => { Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}1`, { reportID: '1', ownerAccountID: 99, - hasOutstandingIOU: true, }).then(() => { expect(ReportUtils.requiresAttentionFromCurrentUser(report)).toBe(false); }); @@ -274,7 +272,6 @@ describe('ReportUtils', () => { it('returns false when the report has no outstanding IOU but is waiting for a bank account and the logged user is the report owner', () => { const report = { ...LHNTestUtils.getFakeReport(), - hasOutstandingIOU: false, ownerAccountID: currentUserAccountID, isWaitingOnBankAccount: true, }; @@ -283,7 +280,6 @@ describe('ReportUtils', () => { it('returns false when the report has outstanding IOU and is not waiting for a bank account and the logged user is the report owner', () => { const report = { ...LHNTestUtils.getFakeReport(), - hasOutstandingIOU: true, ownerAccountID: currentUserAccountID, isWaitingOnBankAccount: false, }; @@ -292,7 +288,6 @@ describe('ReportUtils', () => { it('returns false when the report has no oustanding IOU but is waiting for a bank account and the logged user is not the report owner', () => { const report = { ...LHNTestUtils.getFakeReport(), - hasOutstandingIOU: false, ownerAccountID: 97, isWaitingOnBankAccount: true, }; @@ -319,7 +314,6 @@ describe('ReportUtils', () => { const report = { ...LHNTestUtils.getFakeReport(), ownerAccountID: 99, - hasOutstandingIOU: true, hasOutstandingChildRequest: true, isWaitingOnBankAccount: false, }; diff --git a/tests/unit/SidebarFilterTest.js b/tests/unit/SidebarFilterTest.js index e421e16e270f..dd2985ea34a8 100644 --- a/tests/unit/SidebarFilterTest.js +++ b/tests/unit/SidebarFilterTest.js @@ -295,8 +295,6 @@ describe('Sidebar', () => { // 4. isUnread // 5. isPinned // 6. hasDraft - // There is one setting not represented here, which is hasOutstandingIOU. In order to test that setting, there must be - // additional reports in Onyx, so it's being left out for now. It's identical to the logic for hasDraft and isPinned though. // Given these combinations of booleans which result in the report being filtered out (not shown). const booleansWhichRemovesActiveReport = [ @@ -620,8 +618,6 @@ describe('Sidebar', () => { // 4. isUnread // 5. isPinned // 6. hasDraft - // There is one setting not represented here, which is hasOutstandingIOU. In order to test that setting, there must be - // additional reports in Onyx, so it's being left out for now. It's identical to the logic for hasDraft and isPinned though. // Given these combinations of booleans which result in the report being filtered out (not shown). const booleansWhichRemovesActiveReport = [ diff --git a/tests/unit/SidebarOrderTest.js b/tests/unit/SidebarOrderTest.js index 824e8e6b78e4..44d6dd57de91 100644 --- a/tests/unit/SidebarOrderTest.js +++ b/tests/unit/SidebarOrderTest.js @@ -889,7 +889,6 @@ describe('Sidebar', () => { }; const report3 = { ...LHNTestUtils.getFakeReport([5, 6]), - hasOutstandingIOU: false, // This has to be added after the IOU report is generated iouReportID: null, diff --git a/tests/utils/LHNTestUtils.js b/tests/utils/LHNTestUtils.js index 546853b8893b..8385b3fd3e4b 100644 --- a/tests/utils/LHNTestUtils.js +++ b/tests/utils/LHNTestUtils.js @@ -196,9 +196,6 @@ function getFakeReportAction(actor = 'email1@test.com', millisecondsInThePast = } /** - * There is one setting not represented here, which is hasOutstandingIOU. In order to test that setting, there must be - * additional reports in Onyx, so it's being left out for now. - * * @param {boolean} isArchived * @param {boolean} isUserCreatedPolicyRoom * @param {boolean} hasAddWorkspaceError