11import { beforeEach , describe , expect , it , vi } from "vitest" ;
2- import { MockStorage } from "~test/mocks/storage.js" ;
32import { TEST_CLIENT } from "~test/test-clients.js" ;
43import { TEST_ACCOUNT_A } from "~test/test-wallets.js" ;
54import { createWalletAdapter } from "../../adapters/wallet-adapter.js" ;
65import { ethereum } from "../../chains/chain-definitions/ethereum.js" ;
76import { webLocalStorage } from "../../utils/storage/webStorage.js" ;
87import { createWallet } from "../create-wallet.js" ;
98import { getInstalledWalletProviders } from "../injected/mipdStore.js" ;
10- import { createConnectionManager } from "../manager/index.js" ;
119import { autoConnect } from "./autoConnect.js" ;
1210import { autoConnectCore } from "./autoConnectCore.js" ;
1311
@@ -24,8 +22,6 @@ describe("autoConnect", () => {
2422 onDisconnect : ( ) => { } ,
2523 switchChain : ( ) => { } ,
2624 } ) ;
27- const mockStorage = new MockStorage ( ) ;
28- const mockWalletManager = createConnectionManager ( mockStorage ) ;
2925
3026 beforeEach ( ( ) => {
3127 vi . clearAllMocks ( ) ;
@@ -38,27 +34,24 @@ describe("autoConnect", () => {
3834 const result = await autoConnect ( {
3935 client : TEST_CLIENT ,
4036 wallets : [ mockWallet ] ,
41- walletManager : mockWalletManager ,
4237 } ) ;
4338
4439 expect ( autoConnectCore ) . toHaveBeenCalledWith ( {
4540 storage : webLocalStorage ,
4641 props : {
4742 client : TEST_CLIENT ,
4843 wallets : [ mockWallet ] ,
49- walletManager : mockWalletManager ,
5044 } ,
5145 createWalletFn : createWallet ,
5246 getInstalledWallets : expect . any ( Function ) ,
53- manager : mockWalletManager ,
47+ manager : expect . any ( Object ) ,
5448 } ) ;
5549 expect ( result ) . toBe ( true ) ;
5650 } ) ;
5751
5852 it ( "should use default wallets when no wallets are provided" , async ( ) => {
5953 await autoConnect ( {
6054 wallets : [ ] ,
61- walletManager : mockWalletManager ,
6255 client : TEST_CLIENT ,
6356 } ) ;
6457
@@ -67,7 +60,6 @@ describe("autoConnect", () => {
6760 props : {
6861 client : TEST_CLIENT ,
6962 wallets : [ ] ,
70- walletManager : mockWalletManager ,
7163 } ,
7264 } ) ,
7365 ) ;
0 commit comments