JS: Accept trivial test changes

This adds Alert annotations for alerts that seem intentional by the test
but has not been annotated with 'NOT OK', or the comment was in the wrong
place.

In a few cases I included 'Source' expectations to make it easier to see
what happened. Other 'Source' expectations will be added in bulk a later
commit.
This commit is contained in:
Asger F
2025-02-11 15:06:48 +01:00
parent 0453ded338
commit 10a7294327
177 changed files with 469 additions and 503 deletions

View File

@@ -1,12 +1,3 @@
#select
| AmbiguousIdAttribute.html:4:5:4:14 | id=first | This element has the same id as $@. | AmbiguousIdAttribute.html:5:5:5:14 | id=first | another element |
| AmbiguousIdAttribute_fragment.html:2:7:2:16 | id=first | This element has the same id as $@. | AmbiguousIdAttribute_fragment.html:3:7:3:16 | id=first | another element |
| tst.js:17:22:17:33 | id="theDiff" | This element has the same id as $@. | tst.js:17:46:17:57 | id="theDiff" | another element |
testFailures
| AmbiguousIdAttribute.html:4:5:4:14 | This element has the same id as $@. | Unexpected result: Alert |
| AmbiguousIdAttribute_fragment.html:2:7:2:16 | This element has the same id as $@. | Unexpected result: Alert |
| tst.js:5:67:5:76 | // $ Alert | Missing result: Alert |
| tst.js:7:68:7:77 | // $ Alert | Missing result: Alert |
| tst.js:9:20:9:29 | // $ Alert | Missing result: Alert |
| tst.js:12:60:12:69 | // $ Alert | Missing result: Alert |
| tst.js:19:51:19:60 | // $ Alert | Missing result: Alert |

View File

@@ -1,7 +1,7 @@
<html>
<body>
<ul>
<li id="first">First element
<li id="first">First element <!-- $ Alert[js/duplicate-html-id] -->
<li id="first">Second element
</ul>
</body>

View File

@@ -5,8 +5,8 @@
<li id="second">Second element</li>
<li id="{{templated-id}}">Templated id</li> <!-- ignored -->
<li id="{{templated-id}}">Templated id</li> <!-- ignored -->
<li id="invalid id">Invalid id</li> <!-- reported by another query -->
<li id="invalid id">Invalid id</li> <!-- reported by another query -->
<li id="invalid id">Invalid id</li> <!-- $ Alert[js/malformed-html-id] -->
<li id="invalid id">Invalid id</li> <!-- $ Alert[js/malformed-html-id] -->
<li class="duplicate-class">duplicate-class</li>
<li class="duplicate-class">duplicate-class</li>
</ul>

View File

@@ -1,4 +1,4 @@
<ul>
<li id="first">First element
<li id="first">First element <!-- $ Alert[js/duplicate-html-id] -->
<li id="first">Second element
</ul>

View File

@@ -1,10 +1,3 @@
#select
| ConflictingAttributes.html:1:4:1:27 | href=http://semmle.com | This attribute has the same name as $@ of the same element, but a different value. | ConflictingAttributes.html:1:29:1:53 | href=https://semmle.com | another attribute |
| tst.js:5:4:5:27 | href="h ... le.com" | This attribute has the same name as $@ of the same element, but a different value. | tst.js:5:29:5:53 | href="h ... le.com" | another attribute |
| tst.js:12:4:12:27 | href="h ... le.com" | This attribute has the same name as $@ of the same element, but a different value. | tst.js:12:29:12:46 | href={someValue()} | another attribute |
testFailures
| ConflictingAttributes.html:1:4:1:27 | This attribute has the same name as $@ of the same element, but a different value. | Unexpected result: Alert |
| tst.js:7:68:7:77 | // $ Alert | Missing result: Alert |
| tst.js:9:20:9:29 | // $ Alert | Missing result: Alert |
| tst.js:17:73:17:82 | // $ Alert | Missing result: Alert |
| tst.js:19:51:19:60 | // $ Alert | Missing result: Alert |

View File

@@ -1 +1 @@
<a href="http://semmle.com" href="https://semmle.com">Semmle</a>
<a href="http://semmle.com" href="https://semmle.com">Semmle</a> <!-- $ Alert[js/conflicting-html-attribute] -->

View File

@@ -1,10 +1,3 @@
#select
| DuplicateAttributes.html:1:4:1:28 | href=https://semmle.com | This attribute $@. | DuplicateAttributes.html:1:30:1:54 | href=https://semmle.com | is duplicated later |
| tst.js:7:4:7:28 | href="h ... le.com" | This attribute $@. | tst.js:7:30:7:54 | href="h ... le.com" | is duplicated later |
| tst.js:19:17:19:28 | id="theDiff" | This attribute $@. | tst.js:19:30:19:41 | id="theDiff" | is duplicated later |
testFailures
| DuplicateAttributes.html:1:4:1:28 | This attribute $@. | Unexpected result: Alert |
| tst.js:5:67:5:76 | // $ Alert | Missing result: Alert |
| tst.js:9:20:9:29 | // $ Alert | Missing result: Alert |
| tst.js:12:60:12:69 | // $ Alert | Missing result: Alert |
| tst.js:17:73:17:82 | // $ Alert | Missing result: Alert |

View File

@@ -1,3 +1,3 @@
<a href="https://semmle.com" href="https://semmle.com">Semmle</a>
<a href="https://semmle.com" href="https://semmle.com">Semmle</a> <!-- $ Alert[js/duplicate-html-attribute] -->
<td {% foo %} {% foo %}></td>

View File

@@ -1,16 +1,5 @@
#select
| AmbiguousIdAttributeGood.html:8:5:8:19 | id=invalid id | The value of the id attribute must not contain any space characters. |
| AmbiguousIdAttributeGood.html:9:5:9:19 | id=invalid id | The value of the id attribute must not contain any space characters. |
| MalformedIdAttribute.html:1:6:1:27 | id=heading important | The value of the id attribute must not contain any space characters. |
| tst.js:9:6:9:10 | id="" | The value of the id attribute must contain at least one character. |
| tst.js:10:6:10:13 | id="a b" | The value of the id attribute must not contain any space characters. |
testFailures
| AmbiguousIdAttributeGood.html:8:5:8:19 | The value of the id attribute must not contain any space characters. | Unexpected result: Alert |
| AmbiguousIdAttributeGood.html:9:5:9:19 | The value of the id attribute must not contain any space characters. | Unexpected result: Alert |
| MalformedIdAttribute.html:1:6:1:27 | The value of the id attribute must not contain any space characters. | Unexpected result: Alert |
| tst.js:5:67:5:76 | // $ Alert | Missing result: Alert |
| tst.js:7:68:7:77 | // $ Alert | Missing result: Alert |
| tst.js:10:6:10:13 | The value of the id attribute must not contain any space characters. | Unexpected result: Alert |
| tst.js:12:60:12:69 | // $ Alert | Missing result: Alert |
| tst.js:17:73:17:82 | // $ Alert | Missing result: Alert |
| tst.js:19:51:19:60 | // $ Alert | Missing result: Alert |

View File

@@ -1 +1 @@
<div id="heading important">An important heading</div>
<div id="heading important">An important heading</div> <!-- $ Alert[js/malformed-html-id] -->

View File

@@ -2,18 +2,18 @@
var div1 = <div id="theDiff"></div>;
var div2 = <div id="theDiff"></div>;
<a href="http://semmle.com" href="https://semmle.com">Semmle</a>; // $ Alert
<a href="http://semmle.com" href="https://semmle.com">Semmle</a>; // $ Alert[js/conflicting-html-attribute]
<a href="https://semmle.com" href="https://semmle.com">Semmle</a>; // $ Alert
<a href="https://semmle.com" href="https://semmle.com">Semmle</a>; // $ Alert[js/duplicate-html-attribute]
<div id=""></div>; // $ Alert
<div id="a b"></div>;
<div id=""></div>; // $ Alert[js/malformed-html-id]
<div id="a b"></div>; // $ Alert[js/malformed-html-id]
<a href="http://semmle.com" href={someValue()}>Semmle</a>; // $ Alert
<a href="http://semmle.com" href={someValue()}>Semmle</a>; // $ Alert[js/conflicting-html-attribute]
<div id={someOtherValue()}></div>;
var div3 = <div><div id="theDiff"></div><div id="theDiff"></div></div>; // $ Alert
var div3 = <div><div id="theDiff"></div><div id="theDiff"></div></div>; // $ Alert[js/duplicate-html-id]
var div4 = <div id="theDiff" id="theDiff"></div>; // $ Alert
var div4 = <div id="theDiff" id="theDiff"></div>; // $ Alert[js/duplicate-html-attribute]