Skip to content

Commit 2095c21

Browse files
cursoragentn3ps
andcommitted
test: mock required transaction hash selector
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
1 parent 7e9d3e0 commit 2095c21

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/components/Views/UnifiedTransactionsView/useTransactionsQuery.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { selectEvmAddress } from '../../../selectors/accountsController';
66
import { selectEvmEnabledCaipNetworks } from '../../../selectors/networkEnablementController';
77
import { useTransactionsQuery } from './useTransactionsQuery';
88
import { MINUTE } from '../../../constants/time';
9+
import { selectRequiredTransactionHashes } from '../../../selectors/transactionController';
910

1011
jest.mock('@tanstack/react-query', () => ({
1112
useInfiniteQuery: jest.fn(),
@@ -31,6 +32,10 @@ jest.mock('../../../selectors/networkEnablementController', () => ({
3132
selectEvmEnabledCaipNetworks: jest.fn(),
3233
}));
3334

35+
jest.mock('../../../selectors/transactionController', () => ({
36+
selectRequiredTransactionHashes: jest.fn(),
37+
}));
38+
3439
const ADDRESS_MOCK = '0x1234567890123456789012345678901234567890';
3540
const NETWORKS_MOCK = ['eip155:1', 'eip155:137'];
3641
const QUERY_OPTIONS_MOCK = {
@@ -60,6 +65,9 @@ describe('useTransactionsQuery', () => {
6065
if (selector === selectEvmEnabledCaipNetworks) {
6166
return networks;
6267
}
68+
if (selector === selectRequiredTransactionHashes) {
69+
return new Set<string>();
70+
}
6371
return undefined;
6472
});
6573
}

0 commit comments

Comments
 (0)