mirror of
https://github.com/luxfi/safe-wallet.git
synced 2026-10-30 15:19:21 +00:00
* tests(mobile): add shared createE2eStore factory for e2e singletons
Collapse the duplicated get/set/reset/subscribe + listeners machinery into one
tested factory and adopt it in the Signer-side walletConnectE2eState. The
Wallet-side store reuses it too (added in a later commit).
* fix(mobile): expose WalletConnect proposal sheet to accessibility
@gorhom/bottom-sheet defaults its container to accessible={true}, which
collapses the proposal/request sheet into a single iOS accessibility element
and hides its children from VoiceOver (and Maestro). Set accessible={false} to
expose them, matching the other sheets in the app.
* tests(mobile): add WalletConnect dApp pairing e2e harness
App-side scaffolding to drive WalletConnect dApp pairing/approval
deterministically under Maestro (no live relay):
- walletKitE2eState singleton + fake WalletKit (walletKit.e2e.ts) that replaces
relay calls (pair/approveSession/rejectSession) and reflects approved sessions
via getActiveSessions so the controller can't clobber the slice.
- useHasFeature.e2e.ts force-enables NATIVE_WALLETCONNECT when armed, via a
subscription so consumers re-render on the flag flip.
- E2eScanInjector feeds a wc: URI into the real scanner onScan handler
(Maestro can't drive the camera); prod variant is a no-op.
- walletConnectDappsSetup synth fns + fixtures, exposed via hidden TestCtrls
buttons and a reject side-channel marker.
- Extract a shared onboardAndNavigate + TEST_WALLET_ICON into the setup helpers
and adopt them in connectSignerSetup (de-duplication).
* tests(mobile): add WalletConnect dApp pairing Maestro flows
Seven flows under e2e/tests/walletconnect-dapps/ covering scan happy / invalid /
timeout, deep-link pairing, proposal reject, and the unverified + scam verify
variants, plus JSON fixtures and a README documenting the test-id side-channels
and the iOS accessibility gotchas that shaped the flows.
* tests(mobile): drop unused WC dApp fixture JSON
The JSON files were never imported — the typed factory in walletConnectDappsSetup
(buildProposal) is the canonical fixture source, so the JSON would only drift.
* tests(mobile): harden fake WalletKit and relocate the session fixture
- Default unimplemented fake WalletKit methods to a resolved no-op via a Proxy,
guarding `then`/symbols so the fake isn't mistaken for a thenable.
- Type APPROVED_SESSION and buildProposal as literals (drop `as` casts) so
upstream WC type changes fail at compile instead of at runtime.
- Move APPROVED_SESSION next to the fake (walletKit.e2e.ts) and share the
session topic via walletKitE2eState, removing the feature->test import.
- Reset proposalSeq per flow in setupWcDappsBase.
* docs(mobile): clarify e2e store immutability and proposal-sheet a11y comments
Note that createE2eStore state must be updated via set() (shallow-cloned initial),
and that RequestSheetHost's accessible={false} matches the app's other sheets.
* tests(mobile): dedup pairing-topic literal and copy getActiveSessions result
- Export E2E_PAIRING_TOPIC from walletKitE2eState and use it on both sides
(APPROVED_SESSION + buildProposal) so the shared topic can't drift.
- getActiveSessions() returns a spread copy, matching the real SDK and so a
caller mutating the result can't corrupt the singleton.
- Assert the Proxy symbol guard (Symbol.iterator/asyncIterator read as undefined).
* tests(mobile): deep-clone createE2eStore initial state to enforce reset
reset() (and init) now restore a deep clone of the initial state, so a scenario
that mutated even a nested value can't leak into the next flow — turning the
documented contract into behaviour a regression test enforces.
* tests(mobile): freeze APPROVED_SESSION and use the session-topic constant in tests
- Deeply freeze APPROVED_SESSION so a caller mutating a nested field (it shares
the ref getActiveSessions hands out) can't corrupt the singleton; inline the
fake self.metadata so freezing doesn't touch the shared SAFE_WALLET_METADATA.
- Use E2E_SESSION_TOPIC in the synthSessionDelete test instead of a raw literal.
- Note the Proxy SDK-drift trade-off for future @reown/walletkit bumps.
* docs(e2e): remove README for WalletConnect dApps
---------
Co-authored-by: Hanzo Dev <[email protected]>
41 lines
1.0 KiB
YAML
41 lines
1.0 KiB
YAML
appId: ${APP_ID}
|
|
tags:
|
|
- walletconnect-dapps
|
|
---
|
|
# Invalid QR: open scanner → inject a non-wc string → error overlay → Try again
|
|
# → scanner resets to scanning.
|
|
|
|
- runFlow:
|
|
file: ../../utils/setup/app-start.yml
|
|
|
|
- tapOn:
|
|
id: 'e2eWcDappsBase'
|
|
- assertVisible:
|
|
id: 'home-tab'
|
|
|
|
- tapOn:
|
|
id: 'navbar-qr-button'
|
|
|
|
# Inject a non-wc value — isPairingUri rejects it before any pairing attempt.
|
|
- tapOn:
|
|
id: 'e2e-scan-input'
|
|
- inputText: 'https://example.com/not-a-wc-uri'
|
|
- tapOn:
|
|
id: 'e2e-scan-submit'
|
|
|
|
# Error overlay: the Try again button only renders in the error state, so its
|
|
# presence proves the unrecognised-QR path. (The "Unrecognised QR code" copy
|
|
# shares one merged accessibility label with the button, so anchor on the id.)
|
|
- extendedWaitUntil:
|
|
visible:
|
|
id: 'wc-scan-try-again'
|
|
timeout: 5000
|
|
|
|
# Try again resets the scanner: the error overlay (and its button) clears.
|
|
- tapOn:
|
|
id: 'wc-scan-try-again'
|
|
- extendedWaitUntil:
|
|
notVisible:
|
|
id: 'wc-scan-try-again'
|
|
timeout: 5000
|