@@ -208,33 +208,6 @@ describe('ChainWalletStore', () => {
208208 ) ;
209209 } ) ;
210210
211- it ( 'should set currentWalletName and currentChainName on successful connect' , async ( ) => {
212- const mockAccount : WalletAccount = {
213- address : 'cosmos1abc123' ,
214- pubkey : new Uint8Array ( [ 1 , 2 , 3 ] ) ,
215- isNanoLedger : false ,
216- algo : 'secp256k1' as Algo ,
217- } ;
218-
219- ( mockWallet . connect as jest . Mock ) . mockResolvedValue ( undefined ) ;
220- ( mockWallet . getAccount as jest . Mock ) . mockResolvedValue ( mockAccount ) ;
221-
222- await chainWalletStore . connect ( ) ;
223-
224- expect ( mockInterchainStore . setCurrentWalletName ) . toHaveBeenCalledWith ( 'keplr' ) ;
225- expect ( mockInterchainStore . setCurrentChainName ) . toHaveBeenCalledWith ( 'cosmoshub' ) ;
226- } ) ;
227-
228- it ( 'should not set current values on connection error' , async ( ) => {
229- const error = new Error ( 'Connection failed' ) ;
230- ( mockWallet . connect as jest . Mock ) . mockRejectedValue ( error ) ;
231-
232- await chainWalletStore . connect ( ) ;
233-
234- expect ( mockInterchainStore . setCurrentWalletName ) . not . toHaveBeenCalled ( ) ;
235- expect ( mockInterchainStore . setCurrentChainName ) . not . toHaveBeenCalled ( ) ;
236- } ) ;
237-
238211 it ( 'should handle connection errors' , async ( ) => {
239212 const error = new Error ( 'Connection failed' ) ;
240213 ( mockWallet . connect as jest . Mock ) . mockRejectedValue ( error ) ;
@@ -291,27 +264,6 @@ describe('ChainWalletStore', () => {
291264 ) ;
292265 } ) ;
293266
294- it ( 'should reset currentWalletName and currentChainName on successful disconnect' , async ( ) => {
295- ( mockWallet . disconnect as jest . Mock ) . mockResolvedValue ( undefined ) ;
296-
297- await chainWalletStore . disconnect ( ) ;
298-
299- expect ( mockInterchainStore . setCurrentWalletName ) . toHaveBeenCalledWith ( '' ) ;
300- expect ( mockInterchainStore . setCurrentChainName ) . toHaveBeenCalledWith ( '' ) ;
301- } ) ;
302-
303- it ( 'should not reset current values on disconnection error' , async ( ) => {
304- const consoleSpy = jest . spyOn ( console , 'error' ) . mockImplementation ( ) ;
305- const error = new Error ( 'Disconnection failed' ) ;
306- ( mockWallet . disconnect as jest . Mock ) . mockRejectedValue ( error ) ;
307-
308- await chainWalletStore . disconnect ( ) ;
309-
310- expect ( mockInterchainStore . setCurrentWalletName ) . not . toHaveBeenCalled ( ) ;
311- expect ( mockInterchainStore . setCurrentChainName ) . not . toHaveBeenCalled ( ) ;
312- consoleSpy . mockRestore ( ) ;
313- } ) ;
314-
315267 it ( 'should handle disconnection errors' , async ( ) => {
316268 const consoleSpy = jest . spyOn ( console , 'error' ) . mockImplementation ( ) ;
317269 const error = new Error ( 'Disconnection failed' ) ;
0 commit comments