Skip to content

Commit 6c715c9

Browse files
committed
fix lint
1 parent 699001a commit 6c715c9

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

tests/unit/hooks/useCreateReportRestrictionCheck.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import {renderHook} from '@testing-library/react-native';
22
import useCreateReportRestrictionCheck from '@pages/iou/request/step/IOURequestStepReport/hooks/useCreateReportRestrictionCheck';
33
import type * as OnyxTypes from '@src/types/onyx';
44

5-
const mockShouldRestrict = jest.fn();
5+
const mockShouldRestrict = jest.fn<boolean, unknown[]>();
66

77
jest.mock('@libs/SubscriptionUtils', () => ({
8-
shouldRestrictUserBillableActions: (...args: unknown[]) => mockShouldRestrict(...args),
8+
shouldRestrictUserBillableActions: (...args: unknown[]): boolean => mockShouldRestrict(...args),
99
}));
1010

1111
jest.mock('@hooks/useOnyx', () => ({

tests/unit/hooks/useDistanceRequestData.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ const mockSetMoneyRequestAmount = jest.fn();
77
const mockSetSplitShares = jest.fn();
88

99
jest.mock('@libs/actions/IOU', () => ({
10-
setMoneyRequestAmount: (...args: unknown[]) => mockSetMoneyRequestAmount(...args),
10+
setMoneyRequestAmount: (...args: unknown[]) => {
11+
mockSetMoneyRequestAmount(...args);
12+
},
1113
}));
1214

1315
jest.mock('@libs/actions/IOU/Split', () => ({
14-
setSplitShares: (...args: unknown[]) => mockSetSplitShares(...args),
16+
setSplitShares: (...args: unknown[]) => {
17+
mockSetSplitShares(...args);
18+
},
1519
}));
1620

1721
jest.mock('@libs/DistanceRequestUtils', () => ({

tests/unit/hooks/useOdometerReadingsState.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import useOdometerReadingsState from '@pages/iou/request/step/IOURequestStepDist
33
import CONST from '@src/CONST';
44
import type * as OnyxTypes from '@src/types/onyx';
55

6+
const mockIsOdometerDraftPendingHydration = jest.fn(() => false);
7+
68
jest.mock('@libs/actions/OdometerTransactionUtils', () => ({
7-
isOdometerDraftPendingHydration: jest.fn(() => false),
9+
isOdometerDraftPendingHydration: (...args: unknown[]) => mockIsOdometerDraftPendingHydration(...(args as Parameters<typeof mockIsOdometerDraftPendingHydration>)),
810
}));
911

10-
const {isOdometerDraftPendingHydration} = jest.requireMock('@libs/actions/OdometerTransactionUtils') as {
11-
isOdometerDraftPendingHydration: jest.Mock;
12-
};
13-
1412
type Params = Parameters<typeof useOdometerReadingsState>[0];
1513

1614
const buildOdometerTransaction = (overrides: Partial<OnyxTypes.Transaction['comment']> = {}): OnyxTypes.Transaction =>
@@ -35,7 +33,7 @@ const baseParams: Params = {
3533

3634
describe('useOdometerReadingsState', () => {
3735
beforeEach(() => {
38-
isOdometerDraftPendingHydration.mockReturnValue(false);
36+
mockIsOdometerDraftPendingHydration.mockReturnValue(false);
3937
});
4038

4139
it('starts with empty form state, then hydrates startReading/endReading from the transaction', () => {
@@ -65,7 +63,7 @@ describe('useOdometerReadingsState', () => {
6563
});
6664

6765
it('does not snapshot the baseline while a save-for-later draft is still pending hydration', () => {
68-
isOdometerDraftPendingHydration.mockReturnValue(true);
66+
mockIsOdometerDraftPendingHydration.mockReturnValue(true);
6967
const {result} = renderHook(() =>
7068
useOdometerReadingsState({
7169
...baseParams,

0 commit comments

Comments
 (0)