mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-21 17:36:52 +01:00
update tests
This commit is contained in:
parent
cbbb81e391
commit
25ea9f0bfa
@ -22,7 +22,7 @@ export function Data({
|
||||
|
||||
const networkName = chains.filter(
|
||||
(chain) => chain.id === selectedToken?.chainId
|
||||
)[0].name
|
||||
)?.[0]?.name
|
||||
|
||||
return (
|
||||
<table className={styles.table} aria-disabled={isDisabled}>
|
||||
|
@ -5,7 +5,8 @@ import { useFetchTokens } from './useFetchTokens'
|
||||
test('useFetchTokens does not fetch anything when no chain or address are present', async () => {
|
||||
vi.mock('wagmi', () => ({
|
||||
useChainId: () => undefined,
|
||||
useAccount: () => ({ address: undefined })
|
||||
useAccount: () => ({ address: undefined }),
|
||||
useChains: () => [{ id: 1, name: 'mainnet' }]
|
||||
}))
|
||||
|
||||
function TestComponent() {
|
||||
|
@ -35,6 +35,16 @@ export function useChainId() {
|
||||
return 1
|
||||
}
|
||||
|
||||
export function useChains() {
|
||||
return [mainnet]
|
||||
}
|
||||
|
||||
export function useSwitchChain() {
|
||||
return {
|
||||
switchChain: vi.fn()
|
||||
}
|
||||
}
|
||||
|
||||
export function useAccount() {
|
||||
return {
|
||||
address: '0x0000000000000000000000000000000000000000',
|
||||
|
Loading…
Reference in New Issue
Block a user