Skip to content

Commit 9be41cd

Browse files
committed
test(ResourceRing): fix circular theme mock by using jest.requireActual and re-export useTheme with mockTheme
1 parent b687186 commit 9be41cd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/components/UI/AssetOverview/TronEnergyBandwidthDetail/ResourceRing.test.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ jest.mock('@metamask/design-system-twrnc-preset', () => ({
1111
},
1212
}));
1313

14-
jest.mock('../../../../util/theme', () => ({
15-
useTheme: () => mockTheme,
16-
}));
14+
jest.mock('../../../../util/theme', () => {
15+
const actual = jest.requireActual('../../../../util/theme');
16+
return {
17+
...actual,
18+
useTheme: () => actual.mockTheme,
19+
};
20+
});
1721

1822
describe('ResourceRing', () => {
1923
it('renders the ring icon', () => {

0 commit comments

Comments
 (0)