Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsimao committed Nov 15, 2024
1 parent be0c447 commit 868fe64
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ vi.mock(import('@/hooks'), async (importOriginal) => {

return {
...actual,
useAccount: vi.fn()
useBtcAccount: vi.fn()
};
});

Expand Down
29 changes: 22 additions & 7 deletions apps/evm/src/test-utils/wrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
import { QueryClient, QueryClientProvider } from '@gobob/react-query';
import { BOBUIProvider } from '@gobob/ui';
import { WagmiProvider } from '@gobob/wagmi';
import { WagmiProvider } from 'wagmi';
import { PropsWithChildren } from 'react';
import { getConfig } from '@gobob/wagmi';
import { DynamicWagmiConnector } from '@dynamic-labs/wagmi-connector';
import { DynamicContextProvider } from '@dynamic-labs/sdk-react-core';
import { BitcoinWalletConnectors } from '@dynamic-labs/bitcoin';
import { EthereumWalletConnectors } from '@dynamic-labs/ethereum';

import { isProd } from '@/constants';
import { LinguiClientProvider } from '@/i18n/provider';

export const wrapper = ({ children }: PropsWithChildren) => {
const queryClient = new QueryClient();

return (
<LinguiClientProvider initialLocale='en' initialMessages={{}}>
<QueryClientProvider client={queryClient}>
<WagmiProvider>
<BOBUIProvider>{children}</BOBUIProvider>
<DynamicContextProvider
settings={{
environmentId: process.env.NEXT_PUBLIC_DYNAMIC_ENVIRONMENT_ID as string,
walletConnectors: [BitcoinWalletConnectors, EthereumWalletConnectors]
}}
>
<LinguiClientProvider initialLocale='en' initialMessages={{}}>
<WagmiProvider config={getConfig({ isProd, multiInjectedProviderDiscovery: false })}>
<QueryClientProvider client={queryClient}>
<DynamicWagmiConnector>
<BOBUIProvider>{children}</BOBUIProvider>
</DynamicWagmiConnector>
</QueryClientProvider>
</WagmiProvider>
</QueryClientProvider>
</LinguiClientProvider>
</LinguiClientProvider>
</DynamicContextProvider>
);
};

0 comments on commit 868fe64

Please sign in to comment.