Skip to content
Merged
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
4 changes: 4 additions & 0 deletions tests/unit/CategoryTagPickerAutoFocusTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type Navigation from '@libs/Navigation/Navigation';

import React from 'react';

import {setupGlobalFetchMock} from '../utils/TestHelper';
import waitForBatchedUpdatesWithAct from '../utils/waitForBatchedUpdatesWithAct';

/**
Expand Down Expand Up @@ -50,6 +51,9 @@ jest.mock('@react-navigation/native', () => {
};
});

// The pickers fetch categories/tags on mount. Without a mock, that request throws under Jest and fails whichever test is running.
setupGlobalFetchMock();

function getLastDisableAutoFocus(): boolean | undefined {
const lastCall = mockSelectionList.mock.calls.at(-1);
return lastCall?.[0].textInputOptions?.disableAutoFocus;
Expand Down
Loading