Skip to content

feat(vault): e2e connected-wallet seam (#1591)#1683

Draft
jonybur wants to merge 1 commit into
feat/e2e-1590-wallet-connectfrom
feat/e2e-1591-vp-selection
Draft

feat(vault): e2e connected-wallet seam (#1591)#1683
jonybur wants to merge 1 commit into
feat/e2e-1590-wallet-connectfrom
feat/e2e-1591-vp-selection

Conversation

@jonybur
Copy link
Copy Markdown
Contributor

@jonybur jonybur commented May 18, 2026

Stacked on #1680 (rebased onto updated #1678). Merge order: #1678#1680 → this.

Rescope

#1591 originally asked for provider-selection UI tests. To open the deposit modal you need both wallets connected, and to mock the dApp's data layer you need a stack of GraphQL + contract mocks (Aave config, vault providers, contract reads). The load-bearing piece is the connected-wallet seam - without it nothing in #1591-#1597 can render the deposit-modal at all. This PR ships that seam. The provider-selection UI assertions move to #1592 where the deposit-modal data mocks are introduced.

Production code changes (gated on `NEXT_PUBLIC_E2E_MODE=1`)

  • `services/vault/src/context/wallet/VaultWalletConnectionProvider.tsx`: re-enable the `"injectable"` BTC adapter in e2e mode so the wallet-connector picks up the `window.btcwallet` mock.
  • `services/vault/src/config/wagmi.ts`: in e2e mode, skip AppKit and build a wagmi config whose only connector is wagmi's `mock`. Push it into wallet-connector's shared singleton via `setSharedWagmiConfig` so AppKitProvider transparently reads from the mock account. Auto-connect on next microtask. `E2E_DEFAULT_ETH_ADDRESS` derived from the test private key in `mockEthWallet.ts`.

Production builds (no NEXT_PUBLIC_E2E_MODE) take the existing AppKit path unchanged.

Test infra

  • `e2e/fixtures/connectedWallets.ts` (new): `preConnectWallets({btc, eth})` lands a test in a fully-connected starting state.
  • `e2e/connected-state.spec.ts` (new, 2 tests): proves connect button is gone + "Deposit sBTC" CTA renders.
  • Updated `DEFAULT_BTC_ADDRESS` in `seededWallets.ts` to a real signet Taproot (P2TR) address derived from the test key, because `AddressTypeProvider` gates the deposit CTA on Taproot.
  • Updated `fixtures-smoke.spec.ts` scriptPubKey assertion to match the P2TR shape (5120 + 64 hex).
  • Pinned `NEXT_PUBLIC_BTC_NETWORK=signet` in `playwright.config.ts` so the localStorage scope matches what wallet-connector reads.

Acceptance criteria

Test plan

  • `pnpm --filter vault run lint` → 0 errors
  • `pnpm --filter vault run test:e2e` on the four new/updated spec files → 15/15 passing

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant