Skip to content

Commit

Permalink
fix(solid): revert to inline default state in wallet tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
drichar committed Nov 25, 2024
1 parent b93c080 commit e41113d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/use-wallet-solid/src/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
WalletManager,
WalletId,
DEFAULT_NETWORKS,
DEFAULT_STATE,
type State,
type WalletAccount
} from '@txnlab/use-wallet'
Expand Down Expand Up @@ -189,7 +188,14 @@ describe('useWallet', () => {
beforeEach(() => {
vi.clearAllMocks()

mockStore = new Store<State>(DEFAULT_STATE)
const defaultState = {
wallets: {},
activeWallet: null,
activeNetwork: NetworkId.TESTNET,
algodClient: new algosdk.Algodv2('', 'https://testnet-api.4160.nodely.dev/')
}

mockStore = new Store<State>(defaultState)

mockDeflyWallet = new DeflyWallet({
id: WalletId.DEFLY,
Expand Down

0 comments on commit e41113d

Please sign in to comment.