Repository navigation
Keep the tests that protect money; drop the UI-wording ones - #338
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
text-transform): Dusk accounts are case-sensitive base58.dusknamesWhere 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
npm testlocally: 37 s → 10 sThere were no coverage thresholds to drop, and no dev dependency became unused: the kept page tests still render with Testing Library in jsdom.