Closed Bug 2072913 Opened 1 month ago Closed 1 month ago

Repair the newtab browser-chrome assertions that cannot fail

Categories

(Firefox :: New Tab Page, task)

task

Tracking

()

RESOLVED FIXED
158 Branch
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.

Keywords: leave-open

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.

Assignee: nobody → florian
Status: NEW → ASSIGNED
Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a7b54c35a19a https://hg.mozilla.org/integration/autoland/rev/678771538993 Wait for the bookmark card to stop being one in browser_highlights_section.js, r=mconley.
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
QA Whiteboard: [qa-triage-done-c159/b158]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: