tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 5a7bbc46f6da90fa42b9e0746231ff20510367f1
parent 2bb25af37037a3c0516e2b53e8c49ae50f036b5b
Author: Nicolas Chevobbe <nchevobbe@mozilla.com>
Date:   Wed, 10 Dec 2025 16:17:04 +0000

Bug 1895179 - [devtools] Fix checking valid declaration in checkRuleViewContent. r=devtools-reviewers,bomsy

The assertion was hard to parse and not working as expected.

Differential Revision: https://phabricator.services.mozilla.com/D275228

Diffstat:
Mdevtools/client/inspector/rules/test/head.js | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/devtools/client/inspector/rules/test/head.js b/devtools/client/inspector/rules/test/head.js @@ -1531,12 +1531,14 @@ function checkRuleViewContent(view, expectedElements) { !!expectedDeclaration?.inactiveCSS, `Element #${i} ("${selector}") declaration #${j} ("${propName.innerText}: ${propValue.innerText}") is ${expectedDeclaration?.inactiveCSS ? "inactive" : "not inactive"} ` ); + const isWarningIconDisplayed = !!ruleViewPropertyElement.querySelector( + ".ruleview-warning:not([hidden])" + ); + const expectedValid = expectedDeclaration?.valid ?? true; is( - !!ruleViewPropertyElement.querySelector( - ".ruleview-warning:not([hidden])" - ), - !!expectedDeclaration?.valid, - `Element #${i} ("${selector}") declaration #${j} ("${propName.innerText}: ${propValue.innerText}") is ${expectedDeclaration?.valid === false ? "not valid" : "valid"}` + !isWarningIconDisplayed, + expectedValid, + `Element #${i} ("${selector}") declaration #${j} ("${propName.innerText}: ${propValue.innerText}") is ${expectedValid ? "valid" : "invalid"}` ); is( !!ruleViewPropertyElement.hasAttribute("dirty"),