Skip to content

test: add e2e pagination, property-based, and mutation CI tests#833

Open
Idaonoli wants to merge 1 commit into
Ethereal-Future:mainfrom
Idaonoli:feat/testing-711-712-713-714
Open

test: add e2e pagination, property-based, and mutation CI tests#833
Idaonoli wants to merge 1 commit into
Ethereal-Future:mainfrom
Idaonoli:feat/testing-711-712-713-714

Conversation

@Idaonoli

@Idaonoli Idaonoli commented Jun 27, 2026

Copy link
Copy Markdown

Summary

This PR adds the missing test coverage identified in the four open issues, keeping each change strictly within the scope described.

closes #711 — E2E test for transaction history pagination

e2e/tests/transaction-history.spec.js (new, Playwright)

  • Seeds app account state via addInitScript so tests run without a login form.
  • Mocks both internal API endpoints (/api/v1/transactions/* and /api/stellar/account/*/transactions) with page.route() — no live Stellar network required.
  • Five test cases: initial 20-row load with type/amount/asset assertions; next-page navigation confirming rows change; final-page Next-button disabled state; empty-state illustration visible with no spinner; 503 error showing the error panel and a retry button.
  • Bonus continuity test: loads three pages of 20 and asserts all 60 row aria-labels are unique (no duplicate transaction IDs).

closes #712 — Snapshot tests for all design-system components

frontend/tests/snapshots.test.jsx already covers every component in frontend/src/design-system/ (Button — all 4 variants + 3 sizes + fullWidth + disabled + loading; Badge — all 5 variants; Card — header/footer/padding variants; Input — label/hint/error/fullWidth; Modal — all 3 sizes). The snapshot file is committed and CI runs vitest on every PR, so drift fails the build automatically. No code change needed; this issue is resolved by existing committed tests.

closes #713 — Property-based tests for AmountInput validation

property-tests/amountInput.property.test.js (new, fast-check)

  • Mirrors the two pure functions from AmountInput.jsx: sanitize() (the handleChange regex pipeline) and formatDisplay() (the Intl.NumberFormat formatter).
  • 1000-run properties for: valid decimal strings pass through unchanged; output never contains non-[0-9.] characters; non-numeric chars are always stripped; negative sign is stripped (component rejects negative inputs); multiple dots collapse to one while preserving all digit characters; scientific-notation e is stripped.
  • Display-formatter properties: at most 7 decimal places; integers display without a dot; round-trip parse matches original numeric value.
  • Boundary cases: Stellar max (922337203685.4775807), zero, and 0.0000000 all sanitize correctly.

closes #714 — Mutation test coverage in CI

.github/workflows/mutation-testing.yml — two changes:

  1. Added backend/src/services/** to both push and pull_request path triggers (the stryker mutate scope already covers backend/src/services/*.js, but changes to those files were not triggering the job).
  2. Removed continue-on-error: true from the "Run mutation tests" step so that a mutation score below the break: 50 threshold now fails the CI job as intended.

stryker.config.mjs — added inline comments explaining the rationale for each threshold value (break: 50, low: 60, high: 80) per the acceptance criteria.

Test plan

  • npx playwright test e2e/tests/transaction-history.spec.js --project=chromium — all 5 specs green
  • npm run test:propertyamountInput.property.test.js passes all properties with 1000 runs
  • Confirm mutation CI job triggers on a PR that touches backend/src/services/ (previously it would not)
  • Confirm mutation CI job fails when a mutation causes the score to drop below 50% (previously continue-on-error masked this)
  • npm run test — existing snapshot tests in frontend/tests/snapshots.test.jsx continue to pass with committed snapshots

…uture#711, Ethereal-Future#712, Ethereal-Future#713, Ethereal-Future#714)

- e2e/tests/transaction-history.spec.js: Playwright spec covering initial
  load (20 rows), cursor-based next/prev navigation, final-page Next
  disabled state, empty-state illustration, 503 error with retry button,
  and a three-page uniqueness assertion (no duplicate transaction IDs).
  API responses are mocked via page.route() — no live server required.

- property-tests/amountInput.property.test.js: fast-check property suite
  for the sanitization and display-formatting logic used by AmountInput.
  Covers 1000-run passes for: valid decimal strings pass through unchanged,
  non-numeric characters are stripped, negative sign is rejected, multiple
  dots collapse to one, Stellar 7 d.p. display cap, scientific-notation
  stripping, and round-trip numeric equality for valid Stellar amounts.

- .github/workflows/mutation-testing.yml: add backend/src/services/** to
  path triggers (aligns with the stryker mutate scope) and remove
  continue-on-error so the job actually fails when the break threshold (50%)
  is breached.

- stryker.config.mjs: add inline comments explaining the rationale for the
  break/low/high thresholds per acceptance criteria of Ethereal-Future#714.

Closes Ethereal-Future#711, Ethereal-Future#712, Ethereal-Future#713, Ethereal-Future#714
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Idaonoli Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

1 participant