Repair the newtab browser-chrome assertions that cannot fail
Categories
(Firefox :: New Tab Page, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox158 | --- | fixed |
People
(Reporter: florian, Assigned: florian)
References
(Blocks 1 open bug)
Details
Attachments
(1 external file)
Nineteen checks in browser/extensions/newtab/test/browser cannot fail, so the folder's pass count overstates what it covers.
browser_discovery_render.js is the clearest: its only assertion takes the return value of ContentTaskUtils.waitForCondition, returned only once truthy, so the file reports Subtests passed 1/1 with nothing failable in it. test_render_search_handoff in browser_as_render.js has the same shape, and that file's test_render_logo_false asserts the logo is rendered -- nova.enabled defaults to true, so the branch holding its real assertion never runs.
Seventeen assertions across seven files are vacuous: !found.hidden in seven places, because newtab sets only aria-hidden; className.includes("collapsed") and style.visibility read on elements that carry neither; a .section-title-container that exists nowhere; and two counts the wait above them already pinned.
A check that cannot fail turns a specific failure into a vague one. In bug 2031557 the one check that could have reported a dismissed top site still in the row compared getAttribute("href") on an <li> that never carries it, and the defect surfaced as a wrong tile count instead.
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
The wait that follows the Remove Bookmark click passed querySelectorAll to
waitForCondition. A NodeList is truthy when empty, so the condition held on
the first poll whatever the click did, and it is the test's only assertion
after the click.
Removing the bookmark does not remove the card: the highlight stays on the page
as a history item and loses its .icon-bookmark-added context icon. Nothing
established the card was a bookmark to begin with either, so the new wait needs
the precondition above it or it can pass by running early.
Updated•1 month ago
|
Comment 3•1 month ago
|
||
| bugherder | ||
Updated•1 month ago
|
Description
•