Skip to content

Keep the tests that protect money; drop the UI-wording ones - #338

Merged
HDauven merged 5 commits into
mainfrom
chore/keep-money-tests
Nov 20, 2026
Merged

HDauven merged 5 commits into
mainfrom
chore/keep-money-tests

Conversation

@HDauven

@HDauven HDauven commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Most of the explorer's specs rendered a component or a page and checked its wording, markup or layout, so copy-only changes kept rewriting tests. This drops those and keeps the tests that protect the figures, the states and the parsing. People check payments on the explorer, so what a transaction page or row shows counts as money here.

Kept

  • LUX and DUSK conversion and formatting, the dollar worth of an amount and its fee, the stake's share of the circulating supply, block rewards, fees and gas
  • What a transaction shows, each figure read from its own field and matched exactly: amount, fee, dollars, gas used then limit, gas price, the sign by direction, "Completed" or "Failed" as shown, a failure struck through that only tried (never sent or paid), and what a shielded transfer hides while a public contract or deposit is never called hidden
  • The DuskEVM recipient "on DuskEVM", its full address, the arrival link, and no lookup for a failed deposit or from a list
  • Exact account links, primary names and their Dusk Domains pages, the full ID and both addresses copied, "Copied" only after a copy, and addresses and IDs in their own case (rendered text, and no text-transform): Dusk accounts are case-sensitive base58
  • Transaction and contract call decoding: transfer, stake, Sozu, DuskEVM deposits, .dusk names
  • Search parsing and routing, and paging by IDs: each transaction once, newest first, across "show more", to "58 of 58"
  • The account page's balance, stake, rewards, eligibility, slashes and stDUSK, and that it asks the node nothing about an invalid address
  • The testnet "no value" warning in the layout, no market figures on a test network and the market cap on mainnet, the stale-price warning on the real store, a mempool transaction shown as processing and never confirmed, and provisioners with no stake left out until asked, then unranked
  • The API and GraphQL mapping, the data stores, network detection and the node URL

Where a kept test pinned wording, it now checks the value: fields and cards are found by their labels' names, figures are matched whole with their signs, and a state is checked as the user sees it, its status word and colour read as values. 92 mutations (a failure shown completed, reversed status words, flipped signs, swapped fields, "on Ethereum", uppercased addresses, a mempool message saying confirmed, a history row shown twice, and more) each fail a test.

Counts

  • Spec files: 122 → 70 (45 kept as they were, 23 trimmed or reworked, 2 new, 54 deleted)
  • Test lines: 15,406 → 9,338
  • npm test locally: 37 s → 10 s
  • CI: test step about 87 s → 34 s, whole job about 130 s → 70 s

There were no coverage thresholds to drop, and no dev dependency became unused: the kept page tests still render with Testing Library in jsdom.

Delete the component, page and component-library specs that check what
a screen says or how it is laid out, with the helpers, stubs, fixture
and setup shims only they used.

Keep the tests that guard the figures and the parsing: LUX and DUSK
amounts, the dollar worth of an amount and the stake's share of the
supply, transaction and call decoding (transfer, stake, Sozu, DuskEVM,
.dusk names), search routing, the account page's balance and stake
reads, and the API and GraphQL mapping.

Where a kept test pinned wording, check the value instead. The stake
call sentences, the Unstake label and the 6…6 shortening, until now
asserted only in deleted component specs, move to describeTransaction,
describeCall and a new shortId spec.
Dusk accounts are case-sensitive base58: shown with a text-transform, an
address reads as another, wrong account. The check loads the app's
styles and looks only at that rule, inherited ones included, on a
provisioner's staking address and a transaction's accounts and ID.
The transaction pages are where people check a payment. Bring back, as
value and state checks, the tests that guard what they show:

- each amount, fee, dollar worth and gas figure read from its own field
  and matched exactly, with the sign by direction;
- a failure shown failed, its amount struck through, never said sent;
- the DuskEVM recipient and its network, the arrival link, and no lookup
  for a failed deposit or from a list;
- exact account links, primary names, the full ID copied, and addresses
  shown in their own case;
- what a shielded transfer hides, and a public deposit never hidden;
- each transaction once, newest first, across "show more";
- the testnet and stale-price warnings, the stake labels, the account's
  stake and eligibility, block fees, and provisioners with no stake.

Labels are found by the name of their field, not by their words.
A state or a label is checked as the page shows it, not through a class:

- "Completed" or "Failed" as shown, a failure that only tried, never
  sent or paid, and a stake that staked;
- the mempool answer a string that says it waits for a block, under the
  processing banner, and never that it's confirmed;
- "on DuskEVM" exactly, with the full address on hover;
- both Copy payloads, "Copied" shown only after a copy and then gone,
  and exact names with their Dusk Domains link;
- a privacy explanation that never calls a public contract or deposit
  hidden, with the tooltip's cases restored in a visibilityOf spec;
- signs kept in gas figures and slash counts, eligibility "From" or
  "Since", and the block gas price in its own row;
- statistics cards found by their labels, the market cap on mainnet,
  the testnet warning in the layout, the stale-price warning on the real
  store, no fee or gas in a phone's row, and paging ending at 58 of 58.
- A shared figure matcher finds a number whole and keeps its sign: a
  block's height, a gas limit, slash counts, the price's move and the
  stake's share, with its "24h" and "of circulating supply".
- A failed row's or page's status is exactly "Failed", in one colour and
  never the other; a price's rise and decline are checked both ways.
- "Copied" holds 1.5 s, and never shows after a refused copy.
- The DuskEVM recipient's tooltip is opened and read; a phone's row has
  no fee or gas, its tooltips included.
- Data that gets old with no failed read shows the stale warning, the
  statistics cards show it, and no testnet warning shows before the
  node says its network.
@HDauven
HDauven merged commit 8355267 into main Nov 20, 2026
1 check passed
@HDauven
HDauven deleted the chore/keep-money-tests branch November 20, 2026 19:30
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