File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -238,4 +238,30 @@ describe('InterchainStore', () => {
238238 expect ( osmosisKeplr ) . toBeUndefined ( ) ;
239239 } ) ;
240240 } ) ;
241+
242+ describe ( 'Current Wallet/Chain Auto-Sync' , ( ) => {
243+ it ( 'should set currentWalletName and currentChainName when connected' , ( ) => {
244+ store . updateChainWalletState ( 'keplr' , 'cosmoshub' , {
245+ walletState : WalletState . Connected ,
246+ } ) ;
247+
248+ const state = store . getState ( ) ;
249+ expect ( state . currentWalletName ) . toBe ( 'keplr' ) ;
250+ expect ( state . currentChainName ) . toBe ( 'cosmoshub' ) ;
251+ } ) ;
252+
253+ it ( 'should clear current when disconnecting the current wallet/chain' , ( ) => {
254+ store . updateChainWalletState ( 'keplr' , 'cosmoshub' , {
255+ walletState : WalletState . Connected ,
256+ } ) ;
257+
258+ store . updateChainWalletState ( 'keplr' , 'cosmoshub' , {
259+ walletState : WalletState . Disconnected ,
260+ } ) ;
261+
262+ const state = store . getState ( ) ;
263+ expect ( state . currentWalletName ) . toBe ( '' ) ;
264+ expect ( state . currentChainName ) . toBe ( '' ) ;
265+ } ) ;
266+ } ) ;
241267} ) ;
You can’t perform that action at this time.
0 commit comments