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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.