mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
Tests: Add tests for <select> element behavior
Check that `<select>` element has options available immediately
This commit is contained in:
parent
afb2e063b7
commit
2bf37cb914
Notes:
github-actions[bot]
2024-07-25 14:59:13 +00:00
Author: https://github.com/TSultanov
Commit: 2bf37cb914
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/812
4 changed files with 36 additions and 0 deletions
|
@ -0,0 +1 @@
|
||||||
|
Option 1 PASS (correct value)
|
|
@ -0,0 +1 @@
|
||||||
|
Option 1 PASS (correct value)
|
|
@ -0,0 +1,20 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<script src="../include.js"></script>
|
||||||
|
<select id="select-test"></select>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
const s = document.getElementById("select-test");
|
||||||
|
|
||||||
|
const opt1 = document.createElement("option");
|
||||||
|
opt1.innerText = "Option 1";
|
||||||
|
s.add(opt1);
|
||||||
|
|
||||||
|
const opt2 = document.createElement("option");
|
||||||
|
opt2.innerText = "Option 2";
|
||||||
|
s.add(opt2);
|
||||||
|
|
||||||
|
if (s.value === "Option 1" && s.selectedOptions[0].selected) {
|
||||||
|
println("PASS (correct value)");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -0,0 +1,14 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<script src="../include.js"></script>
|
||||||
|
<select id="select-test">
|
||||||
|
<option>Option 1</option>
|
||||||
|
<option>Option 2</option>
|
||||||
|
</select>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
const s = document.getElementById("select-test");
|
||||||
|
if (s.value === "Option 1" && s.selectedOptions[0].selected) {
|
||||||
|
println("PASS (correct value)");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue