Skip to content

fix: unskip chain reads, run e2e in CI, ignore env variants, make ShareAddressModal a dialog - #1928

Merged
K1NGD4VID merged 10 commits into
LabsCrypt:mainfrom
ademola-star:fix/dialog-e2e-env-chainread
Nov 24, 2026
Merged

K1NGD4VID merged 10 commits into
LabsCrypt:mainfrom
ademola-star:fix/dialog-e2e-env-chainread

Conversation

@ademola-star

@ademola-star ademola-star commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Two gaps that let broken code through (a skipped chain-read path, an e2e suite
no workflow ran), a security hole in the ignore files, and the one modal without
dialog semantics.

Closes #1871
Closes #1872
Closes #1873
Closes #1882

#1871 — chain-read happy paths run again

verifies mock server is called, decodes getStreamFromChain response and
decodes getClaimableFromChain response were it.skip, so the only running
chain-read tests were the failure paths: a change that broke the XDR decoders
outright would have passed CI green.

They were skipped over a stale expectation, not a broken mock harness. The
service returns streamId as the bigint it was called with (u64), and the test
expected a number, so the two could never be deeply equal. The expectation now
uses 7n, with a comment saying why the bigint is the correct type. All 26 tests
in the file pass.

#1872 — the e2e suite is gated

frontend/playwright.config.ts was written CI-aware (forbidOnly, retries, one
worker) and .github/ had zero references to Playwright. The new frontend-e2e
job runs after changes, installs chromium and firefox, runs
npm run test:e2e against the mock servers the config starts itself, and uploads
the HTML report on failure. The identical CI ? [...] : [...] reporter branches
collapsed to one.

#1873 — every env file is ignored

The root and backend/.gitignore matched a file literally named .env, so
backend/.env.local and backend/.env.production were tracked-able while
backend/.env.example documents the JWT_SECRET and KEEPER_SECRET_KEY that
belong in them. Both now use .env* with !.env.example, matching
frontend/.gitignore. Verified with git check-ignore: the two variants are
ignored, the example is not.

Closes #1883
Closes #1884
Closes #1889
Closes #1890

#1882 — ShareAddressModal is a dialog

It was a bare <div>: no role, no aria-modal, an icon-only close button with
no accessible name, and no Escape, focus trap or focus restore. It now uses the
shared useModalDialog hook every other modal here uses, carries
role="dialog" aria-modal="true" aria-labelledby pointing at its title, and its
close button is named.

The new test asserts behaviour rather than markup: the dialog role and its label,
the close button's name, Escape and click each closing exactly once, focus moving
into the dialog on open and staying inside across six Tabs, and the address still
being shown with a copy button.

What breaks if this is wrong

  • The bigint expectation is tied to the service's current return type; if the id
    is ever stringified, this test fails first, which is the intent.
  • The e2e job adds a browser install to the workflow; it is scoped to the same
    changes filter as the frontend job so a docs-only push does not pay for it.
  • !.env.example re-includes every .env.example in the tree, including nested
    ones; that is deliberate, they contain placeholders only.

Closes #1863
Closes #1864
Closes #1865
Closes #1866

Checks run

  • Backend: npx vitest run tests/soroban.service.test.ts — 26 passed, 0 skipped
    (coverage thresholds are enforced on the full run only)
  • Frontend: npx vitest run src/components/dashboard/ShareAddressModal.test.tsx
    — 5 passed
  • Frontend: npx tsc --noEmit — pass; eslint on both changed files — pass
    (lint-staged also ran the workspace lint on commit)
  • python3 -c "yaml.safe_load(...)" on ci.yml — parses, with frontend-e2e
    present
  • git check-ignore -v backend/.env.local backend/.env.production — both
    ignored
  • Not run here: the Playwright suite itself (no browsers installed in this
    sandbox); the new job is the first place it runs

Closes #1855
Closes #1854
Closes #1862
Closes #802

Three success-path tests were skipped, so the suite only proved that the XDR
decoders return null on garbage input; a change that broke decoding entirely
would have passed CI green (LabsCrypt#1871).

They were skipped for a stale expectation, not a broken mock: the service
returns the stream id as the bigint it was called with and the test compared it
to a number. Stream ids are u64, so the bigint is the correct type and the test
now expects it.
playwright.config.ts has been CI-aware since it was written - forbidOnly,
retries, a single worker - and no workflow ever ran it, so three user journeys
had no automated gate and could only rot (LabsCrypt#1872).

Adds a frontend-e2e job alongside the frontend job: install browsers, run
npm run test:e2e against the mock servers the config starts itself, and upload
the HTML report when it fails. The reporter ternary in the config collapsed to
one branch: both sides were identical.
The root and backend ignore files matched only a file literally named .env,
while backend/.env.example documents the JWT_SECRET and KEEPER_SECRET_KEY that
belong in one (LabsCrypt#1873). A contributor following the usual .env.local or
.env.production naming could commit Stellar secret keys; git check-ignore
confirmed neither was ignored. Both files now use .env* with !.env.example, as
frontend/.gitignore already did.
It was a bare div: no role, no aria-modal, no accessible name on the icon-only
close button, and no Escape or focus handling, so a screen reader announced
nothing and Tab walked into the page behind it (LabsCrypt#1882).

It now uses the shared useModalDialog hook every other modal here uses - Escape
closes, Tab cycles within the dialog, focus moves in on open and returns to the
trigger - and carries role=dialog, aria-modal and a labelled title, with a named
close button.

The new test asserts the semantics and the keyboard behaviour rather than the
markup: role and label, the close button's name, Escape and click both closing
once, and focus staying inside across six Tabs.
@ademola-star
ademola-star force-pushed the fix/dialog-e2e-env-chainread branch from c41d80a to 740b24b Compare November 24, 2026 14:45
Comment thread .github/workflows/ci.yml
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
Comment thread .github/workflows/ci.yml
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
Comment thread .github/workflows/ci.yml

- name: Upload the Playwright report
if: failure()
uses: actions/upload-artifact@v4
ademola-star and others added 6 commits November 24, 2026 15:02
Playwright starts config.webServer before it runs globalSetup, so on a
clean checkout the mock server reached its cert guard before
e2e/global-setup.ts had generated e2e/.e2e-certs and the whole suite
died with 'Process from config.webServer was not able to start'.

Generate the self-signed pair here when it is missing, using the same
openssl invocation the global setup uses, so the suite runs from a fresh
clone and in CI. The global setup still short-circuits when the files
already exist.
The creation form validates on submit, so the amount error only exists
after the submit that triggers it, and the detail page shows the live
claimable amount instead of the deposited total. Assert those.
The mock answered every getLedgerEntries key with the session account, so
the withdraw flow's lookup of the recipient failed with "Account not
found", and it built XDR values with constructors the current SDK no
longer exposes (SequenceNumber, XDR union constructors, a missing
inflationDest). Answer the requested key's account, build the entry with
the SDK's factories, and assert the form/page state the app really
renders.
The withdraw builds a real Soroban transaction through the active network
config, whose testnet RPC URL is hardcoded to the public testnet, so the
mock account lookup never happened and the flow failed with "Account not
found". Select the sandbox network, which reads its RPC URL from the
environment, and feed it the mock. Also assert the validation message the
form actually renders.
The form shows the amount error both inline and as a toast, so the plain
text locator is ambiguous under strict mode.
Creating a stream signs and submits a transaction too, so the sandbox
network selection belongs in the shared wallet helper rather than only in
the withdraw test.
@K1NGD4VID
K1NGD4VID merged commit c8ef428 into LabsCrypt:main Nov 24, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment