Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAlec committed Feb 11, 2025
1 parent b286f5e commit b2c1eea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/appchain/bridge/hooks/useAppchainConfig.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getNewReactQueryTestProvider } from '@/identity/hooks/getNewReactQueryTestProvider';
import { renderHook } from '@testing-library/react';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { useReadContract } from 'wagmi';
import { getNewReactQueryTestProvider } from '@/identity/hooks/getNewReactQueryTestProvider';
import { APPCHAIN_DEPLOY_CONTRACT_ADDRESS } from '../constants';
import { useChainConfig } from './useAppchainConfig';

Expand Down
26 changes: 1 addition & 25 deletions src/appchain/bridge/hooks/useDeposit.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { QueryClient } from '@tanstack/react-query';
import { getNewReactQueryTestProvider } from '@/identity/hooks/getNewReactQueryTestProvider';
import { renderHook, waitFor } from '@testing-library/react';
import { type Chain, parseEther, parseUnits } from 'viem';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { useAccount, useConfig, useSwitchChain, useWriteContract } from 'wagmi';
import { http, createConfig } from 'wagmi';
import { waitForTransactionReceipt } from 'wagmi/actions';
import { base } from 'wagmi/chains';
import { mock } from 'wagmi/connectors';
import { getNewReactQueryTestProvider } from '@/identity/hooks/getNewReactQueryTestProvider';
import { useDeposit } from './useDeposit';

// Mock all wagmi hooks
Expand All @@ -30,28 +26,8 @@ vi.mock('wagmi/actions', () => ({
const mockWriteContractAsync = vi.fn();
const mockSwitchChainAsync = vi.fn();

const queryClient = new QueryClient();

const config = createConfig({
chains: [base],
connectors: [
mock({
accounts: [
'0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
'0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
'0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC',
],
}),
],
transports: {
[base.id]: http(),
},
});

// Remove JSX wrapper and use the test provider helper
const wrapper = getNewReactQueryTestProvider();

// Add this mock config after the wrapper definition
const mockAppchainConfig = {
chainId: 1,
contracts: {
Expand Down

0 comments on commit b2c1eea

Please sign in to comment.