From e41113d493fe9f67ef42c72ea0f08ba05626d7b3 Mon Sep 17 00:00:00 2001 From: Doug Richar Date: Mon, 25 Nov 2024 01:33:17 -0500 Subject: [PATCH] fix(solid): revert to inline default state in wallet tests Replace imported `DEFAULT_STATE` with inline state definition to prevent test state pollution. This reverts a change made in 2bb91e4. - Remove `DEFAULT_STATE` import - Define default state directly in `beforeEach` block - Ensure clean store initialization between tests - Fix regression in 'updates wallets when store state changes' test --- packages/use-wallet-solid/src/__tests__/index.test.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/use-wallet-solid/src/__tests__/index.test.tsx b/packages/use-wallet-solid/src/__tests__/index.test.tsx index 19f6d1a7..766f37bc 100644 --- a/packages/use-wallet-solid/src/__tests__/index.test.tsx +++ b/packages/use-wallet-solid/src/__tests__/index.test.tsx @@ -8,7 +8,6 @@ import { WalletManager, WalletId, DEFAULT_NETWORKS, - DEFAULT_STATE, type State, type WalletAccount } from '@txnlab/use-wallet' @@ -189,7 +188,14 @@ describe('useWallet', () => { beforeEach(() => { vi.clearAllMocks() - mockStore = new Store(DEFAULT_STATE) + const defaultState = { + wallets: {}, + activeWallet: null, + activeNetwork: NetworkId.TESTNET, + algodClient: new algosdk.Algodv2('', 'https://testnet-api.4160.nodely.dev/') + } + + mockStore = new Store(defaultState) mockDeflyWallet = new DeflyWallet({ id: WalletId.DEFLY,