Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions tests/actions/ReportTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,7 @@ describe('actions/Report', () => {
...createRandomPolicy(Number(policyID)),
isPolicyExpenseChatEnabled: true,
type: CONST.POLICY.TYPE.TEAM,
autoReportingFrequency: CONST.POLICY.AUTO_REPORTING_FREQUENCIES.IMMEDIATE,
harvesting: {
enabled: false,
},
Expand Down Expand Up @@ -1774,15 +1775,9 @@ describe('actions/Report', () => {
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (reports) => {
Onyx.disconnect(connection);
const createdReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
const parentPolicyExpenseChat = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${parentReport?.reportID}`];

// Wait until the optimistic data has propagated
if (!createdReport?.reportID || parentPolicyExpenseChat?.hasOutstandingChildRequest !== true) {
return;
}

Onyx.disconnect(connection);
// assert correctness of crucial onyx data
expect(createdReport?.reportID).toBe(reportID);
expect(parentPolicyExpenseChat?.hasOutstandingChildRequest).toBe(true);
Expand Down Expand Up @@ -1856,6 +1851,7 @@ describe('actions/Report', () => {
...createRandomPolicy(Number(policyID)),
isPolicyExpenseChatEnabled: true,
type: CONST.POLICY.TYPE.TEAM,
autoReportingFrequency: CONST.POLICY.AUTO_REPORTING_FREQUENCIES.IMMEDIATE,
harvesting: {
enabled: true,
},
Expand Down Expand Up @@ -2075,7 +2071,7 @@ describe('actions/Report', () => {
ownerAccountID: currentUserAccountID,
areRulesEnabled: true,
preventSelfApproval: false,
autoReportingFrequency: 'immediate',
autoReportingFrequency: CONST.POLICY.AUTO_REPORTING_FREQUENCIES.IMMEDIATE,
harvesting: {
enabled: false,
},
Expand Down
Loading