16 Commits
Author SHA1 Message Date
jinhojang6 de9116d0c1 fix(wallet): clamp paste focus to new word count, disable submit while loading 2026-07-28 22:24:10 +09:00
jinhojang6 ac47d665a4 test(wallet): precise e2e coverage for recovery phrase grid 2026-07-28 22:24:10 +09:00
jinhojang6 816bfcde18 feat(wallet): recovery phrase word grid input 2026-07-28 22:24:10 +09:00
Jules ea68132627 feat(wallet): mnemonic account discovery and selection
* feat(wallet): discover active accounts on mnemonic import

Scan successive derivation paths through rpc.proxy (transaction count +
balance) with a BIP-44 gap limit of 20, capped at index 100. Account 0 is
always imported. wallet.import accepts explicit derivationPaths; new
wallet.discoverAccounts and wallet.previewAccount endpoints support
reviewing accounts before import.

* feat(wallet): account selection step in import flow

Show discovered accounts with their activity status and allow adding
custom derivation paths before importing. Falls back to the default path
when the scan finds nothing or fails.

Discovery is triggered from the mnemonic submit handler, not a mount
effect: react-query's MutationObserver detaches from an in-flight
mutation under StrictMode's simulated unmount, leaving the UI pending
forever.

* fix(wallet): send plain JSON-RPC to rpc.proxy in tx monitor

The API route rejects tRPC-style bodies with an opaque 500, so receipt
polling silently never resolved and tx notifications never fired.

* test(e2e): handle account selection step in wallet onboarding

* feat(wallet): persist selected account for a wallet

Add setSelectedAccount metadata helper and wallet.account.select tRPC mutation.

* feat(wallet): account selector in wallet menu

Add account switcher to the wallet selector dropdown and wire currentAccount to the persisted selection via useSelectAccount.

* fix(wallet): scroll long account list in import step

Cap the discovered-accounts list height and scroll it so the custom derivation path input and Continue button stay reachable.

* chore: add changeset
2026-07-16 02:41:14 +09:00
Jules 21095a44d2 fix(wallet): honor LiFi-quoted fees when signing swap transactions
* fix(wallet): honor LiFi-quoted fees when signing swap transactions

Externally priced transactions (LiFi swaps) are trusted for every fee
field they provide. When the quote carries maxPriorityFeePerGas but the
SDK strips maxFeePerGas, derive the ceiling from the quoted priority
plus the estimator's base-fee headroom instead of mixing it with the
internal estimate, which could sign an invalid EIP-1559 tx
(priority > maxFee) rejected at broadcast. Wallet-originated
transactions still use internal estimation for all fields.

* test(e2e): cover swap with quote-time LiFi priority fee

Add a quoted-priority knob to the LiFi mock, expose it as a fixture,
and assert a swap quoted above the wallet's internal fee ceiling still
signs a valid tx that pays the quoted priority.

* chore: add changeset
2026-07-10 20:03:46 +09:00
Jules ac76ed4f06 test(e2e): wallet extension send/swap suites on Anvil forks
* refactor(e2e): extract shared extension launcher from MetaMask fixture

Move the persistent-context + temp-profile + SW-derived extension-id
logic into launchExtensionContext (with beforeLaunch, afterClose,
extraChromeArgs, profilePrefix, viewport options) so other extensions
can reuse it. MetaMask fixture becomes a thin wrapper; behavior
unchanged for the existing Hub suite.

* feat(e2e): add congestion and balance controls to Anvil helper

Add setNextBlockBaseFee, setBlockGasLimit, disableAutoMining,
dropTransaction, setEthBalanceFor, and getEthBalance for staging
network conditions and localizing accounts on the forks.

* feat(e2e): add rpc-router and opt-in wallet test-server orchestration

Anvil only answers JSON-RPC at / while apps/api appends path suffixes
(/ethereum/mainnet/alchemy), so add a small host-side router that
strips the prefix and forwards by chain segment to the forks.

Wire wallet-send/wallet-swap Playwright projects behind the
RUN_WALLET_E2E env flag (env rather than argv: workers re-evaluate the
config without --project) with apps/api and the router as web servers,
narrow the @wallet grep so it no longer swallows the new tags, and add
setup:wallet / test:wallet-* scripts. setup:wallet passes
WXT_STATUS_API_URL explicitly because wxt build --mode development
otherwise bakes the production API URL.

* chore: add changeset

* ci: point changesets and workflow triggers at master

The main branch was renamed to master, so origin/main no longer exists:
the changeset status step failed to find the divergence point, and the
CI/E2E/Release push triggers never fired.

* feat(e2e): add wallet page objects

Onboarding (seed import), portfolio, send modal (Max fees parsing,
password step, Confirm-with-new-gas-price, success toast), and a thin
LiFi swap-drawer wrapper. Add a clickVisible helper to BasePage since
the wallet renders controls twice (desktop + hidden mobile variant).

* feat(e2e): add wallet extension fixture stack with API data seam and LiFi mock

wallet-extension.fixture provides anvilRpc with per-test
snapshot/revert isolation, the dev-built extension context, seed-import
onboarding (compliant password decoupled from WALLET_PASSWORD), and
page-object fixtures.

status-api-mocks intercepts only the Alchemy enhanced-API tRPC routes
(assets.all, assets.nativeToken, activities.page) with fork-consistent
fixtures and exposes setFeeRate for the gas-shift test; rpc.proxy and
nodes.* pass through to the real backend and fork. lifi-mock serves
every li.quest endpoint the widget/SDK call; the mocked step calldata
is a real WETH9 deposit() so the swap executes genuinely on the fork
with an exactly assertable 1:1 output.

* test(e2e): add wallet send network-condition suite

Happy path with on-chain delta assertion, slow inclusion (no state
change until mineBlock), high base fee reflected in quoted Max fees and
actually paid, and a deterministic GasShiftedError -> Confirm with new
gas price flow via a pinned fee quote bumped mid-signing. The planned
tight-gas-limit row was dropped: Anvil estimates a 21k transfer fine
under a 20k block limit, making the scenario artificial.

* test(e2e): add wallet swap suite against mocked LiFi quotes

ETH -> WETH via the exchange drawer with recorded li.quest fixtures:
happy path with exact 1:1 on-chain output assertion, slow inclusion
(widget pending until mineBlock), and high base fee (swap executes,
elevated gas provably paid). Deliberately shallow on adverse-condition
UX, which LiFi owns; the deep matrix lives in the send suite.

* ci: add wallet e2e job

Build the extension in dev mode (WXT_STATUS_API_URL pointed at the
local api), start the forks (optionally against an archive upstream
via the E2E_MAINNET_FORK_URL secret), and run the wallet-send and
wallet-swap projects under xvfb with RUN_WALLET_E2E=1. apps/api boots
with dummy secrets since chain calls hit the fork and enhanced
endpoints are seam-mocked.

* chore: add changeset

* fix(e2e): disambiguate send success toast from its aria-live announcer

Radix Toast renders a hidden screen-reader announcer that duplicates the
toast message as "Notification Transaction signed and sent", so the
substring locator intermittently resolved to two elements and tripped
Playwright strict mode in CI.

* fix(e2e): keep vault accounting consistent when seeding shares

The live WETH pre-deposit vault drained below 1 token of totalSupply, so
seeding 1e18 shares via a bare balance-slot write made the on-chain
withdraw revert InvalidState() (amount exceeds stored totalAssets, burn
exceeds totalSupply) -- the forks track the latest block, so state drift
broke the test without a code change.

fundVaultShares now bumps the vault's totalSupply and stored totalAssets
by the seeded delta. Backing slots are discovered by value match plus a
write probe (the vaults keep both values equal, so a match alone is
ambiguous) and cached per vault.

* chore: add changeset
2026-07-10 19:25:43 +09:00
Jules 99ce990804 feat(e2e): shared infra for extension-based wallet tests
* refactor(e2e): extract shared extension launcher from MetaMask fixture

Move the persistent-context + temp-profile + SW-derived extension-id
logic into launchExtensionContext (with beforeLaunch, afterClose,
extraChromeArgs, profilePrefix, viewport options) so other extensions
can reuse it. MetaMask fixture becomes a thin wrapper; behavior
unchanged for the existing Hub suite.

* feat(e2e): add congestion and balance controls to Anvil helper

Add setNextBlockBaseFee, setBlockGasLimit, disableAutoMining,
dropTransaction, setEthBalanceFor, and getEthBalance for staging
network conditions and localizing accounts on the forks.

* feat(e2e): add rpc-router and opt-in wallet test-server orchestration

Anvil only answers JSON-RPC at / while apps/api appends path suffixes
(/ethereum/mainnet/alchemy), so add a small host-side router that
strips the prefix and forwards by chain segment to the forks.

Wire wallet-send/wallet-swap Playwright projects behind the
RUN_WALLET_E2E env flag (env rather than argv: workers re-evaluate the
config without --project) with apps/api and the router as web servers,
narrow the @wallet grep so it no longer swallows the new tags, and add
setup:wallet / test:wallet-* scripts. setup:wallet passes
WXT_STATUS_API_URL explicitly because wxt build --mode development
otherwise bakes the production API URL.

* chore: add changeset

* ci: point changesets and workflow triggers at master

The main branch was renamed to master, so origin/main no longer exists:
the changeset status step failed to find the divergence point, and the
CI/E2E/Release push triggers never fired.
2026-07-10 18:59:46 +09:00
Felicio 8ab08c76c6 refactor(static export): streamline HTML alias creation and add Playwright tests for static exports (#1271) 2026-07-09 15:25:05 +09:00
Felicio 3f3b6f3794 fix layout for statically exported apps/ (#1248) 2026-07-08 19:22:55 +09:00
Jules d4608dc4ac test(e2e): add Hub withdrawal test suite
* test(e2e): run the suite against a local Hub

Start the Hub dev server via Playwright's webServer and default BASE_URL to
localhost so tests exercise local code; set BASE_URL to test a deployment.
Pre-compile routes in global-setup, derive the wallet address from the seed
(dropping WALLET_ADDRESS), and let anvil:up/down run without a .env file.

* ci(e2e): build and serve the local Hub with forks

Drop the deployed-URL logic; build Hub deps, start Anvil forks, and run all
projects against the webServer-started local Hub.

* test(e2e): add Hub withdrawal (unlock/claim) suite

Smoke checks for the withdrawal-only Pre-Deposits page, plus an Anvil-backed
suite that seeds vault shares and drives the unlock modal: CTA gating,
receiver pre-fill, confirmation checkboxes, address validation, and the
wrong-chain network-switch prompt. Adds a fundVaultShares helper, a
connected-account helper, and withdrawal page objects.

* test(e2e): verify on-chain withdrawal execution

Submit the real `withdraw` tx through MetaMask against the Anvil forks and
assert on-chain results: WETH/SNT burn the deposit and move to "Bridging"
(L1 leg of the cross-chain flow); LINEA does the same-chain claim, burning
shares and crediting the receiver on Linea.
2026-06-22 19:45:46 +09:00
Jules b6685999bc test(e2e): run the suite against a local Hub
* test(e2e): run the suite against a local Hub

Start the Hub dev server via Playwright's webServer and default BASE_URL to
localhost so tests exercise local code; set BASE_URL to test a deployment.
Pre-compile routes in global-setup, derive the wallet address from the seed
(dropping WALLET_ADDRESS), and let anvil:up/down run without a .env file.

* ci(e2e): build and serve the local Hub with forks

Drop the deployed-URL logic; build Hub deps, start Anvil forks, and run all
projects against the webServer-started local Hub.
2026-06-22 18:40:53 +09:00
Jules b501af3781 feat(e2e): add reusable Anvil wallet harness
* chore(e2e): remove dead pre-deposit deposit tests

Deposits are sunsetted; the Hub pre-deposits page is now withdrawal-only.
Drop the network-switch and validation specs, the deposit modal page
object, and the now-unused TEST_AMOUNTS and clickDepositForVault helpers.

* fix(e2e): repair pre-deposits display smoke test

- sidebar: match the renamed "Pre-deposit vaults" link
- vaultHeadings: anchor to "<token> vault" so FAQ headings aren't counted
- assert exact vault names to avoid FAQ strict-mode collisions

* chore: add changeset

* ci(e2e): align workflow triggers with CI

Run on push to main, pull_request, and workflow_call.
Drop deployment_status, path filters, and manual dispatch.

* feat(e2e): expand MetaMask harness for transaction flows

Add tx, token-spend and signature approval to the notification page
object, expose a reusable launchMetaMaskContext, and split VIEWPORT into
its own constants module. Drop the unused home page object.

* feat(e2e): add Anvil fork wallet harness

Local mainnet + Linea Anvil forks (docker compose + eRPC) with an
AnvilRpcHelper for funding and snapshot/revert, MetaMask RPC redirection
(service-worker patch + Smart Transactions disabler), and a Hub-connected
anvil fixture decoupled from any feature. Adds anvil:up/down + test:anvil
scripts and an `anvil` Playwright project; reads metamaskVersion from
package.json.

* chore(e2e): add changelog
2026-06-17 01:51:21 +09:00
Jules 1036c9397e chore(e2e): remove dead pre-deposit deposit tests
* chore(e2e): remove dead pre-deposit deposit tests

Deposits are sunsetted; the Hub pre-deposits page is now withdrawal-only.
Drop the network-switch and validation specs, the deposit modal page
object, and the now-unused TEST_AMOUNTS and clickDepositForVault helpers.

* fix(e2e): repair pre-deposits display smoke test

- sidebar: match the renamed "Pre-deposit vaults" link
- vaultHeadings: anchor to "<token> vault" so FAQ headings aren't counted
- assert exact vault names to avoid FAQ strict-mode collisions

* chore: add changeset

* ci(e2e): align workflow triggers with CI

Run on push to main, pull_request, and workflow_call.
Drop deployment_status, path filters, and manual dispatch.
2026-06-17 00:24:45 +09:00
9d803e8d2a test: add deposit flow E2E tests (network switch, validation) (#1043)
* Add E2E tests and fixtures for MetaMask wallet integration and Pre-Deposits functionalities

* Enhance MetaMask notification handling and improve E2E test robustness

* Add pnpm workspace file for E2E test setup

* chore(hub): add changeset

* Refactor timeout configurations and relocate Pre-Deposits E2E test under hub module

* Reorganize E2E configuration and workflows; refactor imports and environment handling

* Refactor E2E environment handling: centralize env types, simplify `EnvConfig`, and reduce workflow timeout to 15 mins

* Add E2E tests for deposit flows with network switching and validation

- Implement comprehensive Pre-Deposit tests for network switching and balance validation.
- Enhance MetaMask handling with dismissPendingAddNetwork and popup detection improvements.
- Extend constants and page objects to support new test cases.

* Refactor timeout configurations across components and tests; standardize and replace hardcoded values with constants.

* Refactor MetaMask extension download: use specific versioning, remove unused env vars, and streamline process

* Remove `pnpm-lock.yaml` and refactor Pre-Deposits E2E test imports and MetaMask handling

* chore: add empty changeset for CI

* Refactor MetaMask connection approval: simplify button handling and remove redundant steps

* Refactor Pre-Deposit E2E tests: use shared chain ID constants and update Node.js version in workflow

* refactor: extract chain constants and use flexible node version in CI

* Refactor e2e tests: centralize MetaMask network switching and SIWE dialog dismissal logic into reusable helpers.

* Add `@helpers/*` path alias to e2e `tsconfig.json`

* Add E2E tests for deposit flow

Added end-to-end tests for the deposit flow, including network switch and validation checks.

* Delete .changeset/bold-candies-clap.md

---------

Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im>
Co-authored-by: JulesFILIOT <dev@julesfiliot.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Felicio <felicio@users.noreply.github.com>
2026-03-23 14:37:11 +09:00
github-actions[bot]andgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> 5cae149418 Release (#883)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-09 11:41:24 +00:00
5a5673e69f test: add E2E testing framework with MetaMask integration for SN Hub (#1032)
Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im>
Co-authored-by: JulesFILIOT <dev@julesfiliot.com>
Co-authored-by: Felicio <felicio@users.noreply.github.com>
2026-02-25 14:35:49 +09:00