Skip to content

walletStore has no tests: connection and account state is uncovered #897

Description

@nanaf6203-bit

walletStore has no tests: connection and account state is uncovered

Labels / Complexity: testing · Medium Complexity — Medium

Problem

walletStore (src/store/walletStore.ts) holds the app's wallet connection state — the store every wallet-gated component reads. It has no tests. A regression that leaves a stale account after disconnect or drops the connected state ships silently at the center of the wallet UX.

Why this is architecturally hard

  1. State transitions are the test design. Tests must pin connect (account + chain), disconnect (full reset), and switching-account paths.
  2. Persistence interaction. If the store hydrates from storage (see useWalletHydration), tests must cover the hydration merge so the two cannot disagree.

Acceptance criteria

  • Tests cover connect, disconnect, account switch, and hydration merge.
  • Tests run in CI via npm test.

Out of scope

Connector internals; other stores.

Getting started

  • src/store/walletStore.ts — the store
  • src/store/__tests__/transactionStore.test.ts — the existing store test pattern

Commands: npm test.

Good first files to read: src/store/walletStore.ts, src/store/__tests__/transactionStore.test.ts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions