Skip to content

walletConnectors lib has no tests: connector adapters are uncovered #937

Description

@nanaf6203-bit

walletConnectors lib has no tests: connector adapters are uncovered

Labels / Complexity: testing · Medium Complexity — Medium

Problem

src/lib/walletConnectors/ contains the connector adapters (including walletconnect.ts, which carries the __MOCK_WALLETCONNECT__ E2E hook at line 20). None has tests. The adapters are the boundary between the app and external wallet providers; a regression in account-address handling or chain reporting ships silently into every connect flow.

Why this is architecturally hard

  1. Provider fakes are the test design. The adapters wrap external providers; tests need stubbed provider objects asserting the adapter's mapping (addresses, chain ids, errors).
  2. The mock hook must be pinned. The __MOCK_WALLETCONNECT__ path (line 20-25) is exactly the kind of branch that drifts; tests should pin both the mock and real paths.

Acceptance criteria

  • Tests cover the adapter mapping for mocked providers (address/chain/error cases).
  • Tests run in CI via npm test.

Out of scope

Connector internals; the wallet hook layer.

Getting started

  • src/lib/walletConnectors/ — the adapters
  • src/hooks/__tests__/ — the hook test pattern

Commands: npm test.

Good first files to read: src/lib/walletConnectors/walletconnect.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