Skip to content

Commit e362672

Browse files
committed
update test
1 parent 496b824 commit e362672

1 file changed

Lines changed: 2 additions & 52 deletions

File tree

tests/actions/IOU/PerDiemTest.ts

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
33
import type {RequestMoneyParticipantParams} from '@libs/actions/IOU';
44
import type {PerDiemExpenseTransactionParams} from '@libs/actions/IOU/PerDiem';
55
import {addSubrate, clearSubrates, computePerDiemExpenseAmount, getPerDiemExpenseInformation, removeSubrate, submitPerDiemExpense, updateSubrate} from '@libs/actions/IOU/PerDiem';
6-
import * as ReportUtils from '@libs/ReportUtils';
76
import CONST from '@src/CONST';
87
import DateUtils from '@src/libs/DateUtils';
98
import ONYXKEYS from '@src/ONYXKEYS';
@@ -336,55 +335,6 @@ describe('PerDiem', () => {
336335
expect(currencyUpdate?.value).toEqual([testCurrency, ...initialCurrencies]);
337336
});
338337

339-
it('should forward conciergeReportID to buildOptimisticReportPreview', () => {
340-
const conciergeReportID = 'concierge_report_999';
341-
const buildPreviewSpy = jest.spyOn(ReportUtils, 'buildOptimisticReportPreview');
342-
343-
const mockTransactionParams: PerDiemExpenseTransactionParams = {
344-
comment: '',
345-
currency: CONST.CURRENCY.USD,
346-
created: '2024-02-02',
347-
category: 'Meals',
348-
tag: '',
349-
customUnit: {
350-
customUnitID: 'per_diem_unit',
351-
customUnitRateID: 'rate_1',
352-
name: CONST.CUSTOM_UNITS.NAME_PER_DIEM_INTERNATIONAL,
353-
attributes: {dates: {start: '2024-02-02', end: '2024-02-02'}},
354-
subRates: [],
355-
quantity: 1,
356-
},
357-
billable: false,
358-
attendees: [],
359-
reimbursable: true,
360-
};
361-
362-
getPerDiemExpenseInformation({
363-
parentChatReport: {} as OnyxEntry<Report>,
364-
transactionParams: mockTransactionParams,
365-
participantParams: {
366-
payeeAccountID: 123,
367-
payeeEmail: 'payee@example.com',
368-
participant: {accountID: 123, login: 'payee@example.com'},
369-
} as unknown as RequestMoneyParticipantParams,
370-
recentlyUsedParams: {},
371-
isASAPSubmitBetaEnabled: false,
372-
currentUserAccountIDParam: 123,
373-
currentUserEmailParam: 'payee@example.com',
374-
hasViolations: false,
375-
policyRecentlyUsedCurrencies: [],
376-
quickAction: undefined,
377-
betas: [CONST.BETAS.ALL],
378-
personalDetails: {123: {accountID: 123, login: 'payee@example.com'}},
379-
conciergeReportID,
380-
});
381-
382-
const previewCallWithConcierge = buildPreviewSpy.mock.calls.find((args) => args.at(6) === conciergeReportID);
383-
expect(previewCallWithConcierge).toBeDefined();
384-
385-
buildPreviewSpy.mockRestore();
386-
});
387-
388338
it('should return correct per diem expense information with new chat report', () => {
389339
// Given: Mock data for per diem expense
390340
const mockCustomUnit = {
@@ -463,7 +413,7 @@ describe('PerDiem', () => {
463413
quickAction: undefined,
464414
betas: [CONST.BETAS.ALL],
465415
personalDetails: {[mockParticipant.accountID]: {accountID: mockParticipant.accountID, login: 'existing@example.com'}},
466-
conciergeReportID: undefined,
416+
conciergeReportID: 'concierge_chat_001',
467417
});
468418

469419
// Then: Verify the result structure and key values
@@ -687,7 +637,7 @@ describe('PerDiem', () => {
687637
quickAction: undefined,
688638
betas: [CONST.BETAS.ALL],
689639
personalDetails: {[mockParticipant.accountID]: {accountID: mockParticipant.accountID, login: 'existing@example.com'}},
690-
conciergeReportID: undefined,
640+
conciergeReportID: 'concierge_chat_002',
691641
});
692642

693643
// Then: Verify policy expense chat handling

0 commit comments

Comments
 (0)