Skip to content

Commit 873cdee

Browse files
committed
tests(predict): mock theme with accent04 in usePredictDeposit.test to prevent init crash
1 parent 99e9156 commit 873cdee

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

app/components/UI/Predict/hooks/usePredictDeposit.test.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Engine from '../../../../core/Engine';
44
import Logger from '../../../../util/Logger';
55
import { PredictTradeStatus } from '../constants/eventNames';
66
import { ConfirmationLoader } from '../../../Views/confirmations/components/confirm/confirm-component';
7+
import { TEST_HEX_COLORS as mockTestHexColors } from '../testUtils/mockColors';
78

89
const mockGoBack = jest.fn();
910
const mockNavigateToConfirmation = jest.fn();
@@ -32,12 +33,18 @@ jest.mock('../../../../util/Logger', () => ({
3233
error: jest.fn(),
3334
}));
3435

35-
jest.mock('../../../../util/theme', () => {
36-
const { mockTheme } = jest.requireActual('../../../../util/theme');
37-
return {
38-
useAppThemeFromContext: () => mockTheme,
39-
};
40-
});
36+
jest.mock('../../../../util/theme', () => ({
37+
useAppThemeFromContext: jest.fn(() => ({
38+
colors: {
39+
error: {
40+
default: mockTestHexColors.ERROR_DARK,
41+
},
42+
accent04: {
43+
normal: mockTestHexColors.ACCENT_BLUE,
44+
},
45+
},
46+
})),
47+
}));
4148

4249
jest.mock('../../../../component-library/components/Toast', () => {
4350
const actualReact = jest.requireActual('react');

0 commit comments

Comments
 (0)