Reference in New Issue
Block a user
Delete Branch "issue-188-dod-assertions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #188.
The suite asserted that the two screens
#150 and
#151 broke now open without
throwing. The four remaining definition-of-done items are asserted here.
Additive: four tests and one fixture flag, no existing test or helper changed.
What is asserted
Back navigation out of Add Token. Against the persisted navigation stack,
read from extension storage, as a delta: the round trip Home -> AddressDetail
-> AddToken -> Back -> Back must leave the stack exactly as it found it, with
["main"]and then["main","address"]on top at the two forward steps. Astale entry is invisible on screen until the user presses Back one time too
many — the second-order damage of #150 — so the stack rather than the visible
view is what gets asserted. Stating it as a delta makes it independent of
whatever depth earlier tests leave behind.
The common-token quick-pick. Clicks the first button and requires
#add-token-addressto hold that button'sdata-address; the field isasserted empty first. The old test counted the buttons rendered.
The native ETH detail path. This needed a fixture: the Blockscout
normal-transactions endpoint answered
{items: []}unconditionally, so therewas no non-ERC-20 row to open at all.
seedNativeTransferserves one 0.25 ETHtransfer (above the default dust threshold, its own hash so
mergeTransactions()does not fold it into the token transfer). The detailscreen must show the native hash, type
Native ETH Transfer, the value, theraw wei quantity, and no token contract row — that row's branch is where a
regression of the non-ERC-20 case lands. The flag is cleared again at the end
of the test, so every later test sees the list it was written against.
Tap-to-copy. Reads the real clipboard back rather than watching the handler
run, after seeding a sentinel so an untouched clipboard cannot pass. Clipboard
permissions are granted context-wide: an origin-scoped grant is refused for
chrome-extension:URLs (Permission can't be granted to opaque origins).Nothing was weakened and no item was dropped. All four are driven from the
Chrome harness; the Firefox suite was not touched.
Each assertion demonstrated failing
One deliberate break at a time, full
make test-e2erun, source reverted aftereach. In every case the pre-existing tests 4 and 5 stayed green, so each
failure is attributable to the new assertion.
src/popup/index.js,showAddTokenViewpushes twice:A screen-only assertion does not see this: the first Back still lands on the
address screen.
src/popup/views/addToken.js, the click handler made a no-op:src/popup/views/transactionDetail.jsremoved, i.e. the ERC-20 branch runningfor a transfer with no contract:
And the same row left visible without throwing, which is what isolates the
hidden-row assertion itself:
attachCopyHandlers()insrc/popup/views/helpers.jskeepsthe flash and drops the
writeText:The flash-only half of the assertion passes against this break; the clipboard
read is what catches it.
Verification
Ran, after rebasing onto
nextat0be20d7(which reworkedgoBack(), so thewhole suite was re-run rather than trusted):
make check— green. 703 tests in 29 suites,test-verify-build18 cases,prettier --checkclean twice (lint and fmt-check).make test-e2e— green, 44/44, with the four new tests at 6-9.make fmt— run, result committed.Not run:
make test-e2e-firefox. This change adds nothing to the Firefoxsuite.
script/linthere isprettier --checkon the host, not containerized;that is the repo's current entrypoint, and ESLint for it is
#152.
PASS — independently verified on my own clone of head
e53bcb6:make checkgreen,make test-e2e44/44, all four items of #188 asserted, and each new assertion re-demonstrated failing here (duplicatepushCurrentView()inshowAddTokenViewreds test 6 alone; no-op quick-pick handler reds 7;tx.contractAddressguard forced true reds 8 with thepageerror; the same guard's else branch left unhidden reds 8 on the hidden-row assertion alone; droppingnavigator.clipboard.writeTextfromattachCopyHandlers()reds 9), tree restored after each; head contains currentnext, no Claude/Anthropic references, no attribution trailers.Disclosures: my first e2e run failed tests 38 and 44 in the dApp section, green on the rerun and on all five mutation runs — the known flake of #287 and #290, not attributable to this change. Outside the four items #188 scoped, these definition-of-done items of #150 and #151 remain unasserted anywhere in the suite after this closes: adding a token by contract address and seeing it in the balance list, opening a token-transfer row from AddressToken, the etherscan token link on the contract row, and Back returning to the originating view — a follow-up issue, not a defect in this PR.
script/lintis hostprettier --check, not containerized (#152), so the lint evidence is only as good as that entrypoint.clawbot referenced this pull request2026-08-17 08:09:34 +02:00
e53bcb655dtod8fcbaac5aclawbot referenced this pull request2026-08-17 08:23:41 +02:00