1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

LibWeb/Tests: Port HTMLCollection [[SameObject]] test to a text test

This test was written before we had the facility to write text tests -
port this test to a text test so that we test against it in CI.
This commit is contained in:
Shannon Booth 2023-08-21 21:47:44 +12:00 committed by Andreas Kling
parent e300da4db4
commit 6cee028ecc
3 changed files with 46 additions and 52 deletions

View file

@ -0,0 +1,33 @@
<html>
<form><table><thead><tr><td></td></tr></thead></table></form>
<script src="include.js"></script>
<script>
test(() => {
function testElement(expr) {
let a = eval(expr);
let b = eval(expr);
println(`${expr} ${(a === b) ? "pass" : "fail"}`);
}
let table = document.querySelector("table")
let tr = document.querySelector("tr")
let form = document.querySelector("form")
let thead = document.querySelector("thead")
testElement("table.tBodies")
testElement("table.rows")
testElement("thead.rows")
testElement("tr.cells")
testElement("form.elements")
testElement("document.applets")
testElement("document.anchors")
testElement("document.images")
testElement("document.embeds")
testElement("document.plugins")
testElement("document.links")
testElement("document.forms")
testElement("document.scripts")
});
</script>
</html>