Преглед изворни кода

Tests: Add test for selection option in <select>

Verify that we can select option using JS
Timur Sultanov пре 1 година
родитељ
комит
1ce9bbdd6d

+ 1 - 0
Tests/LibWeb/Text/expected/HTML/HTMLSelectElement-can-select-option-in-JS.txt

@@ -0,0 +1 @@
+B  PASS

+ 16 - 0
Tests/LibWeb/Text/input/HTML/HTMLSelectElement-can-select-option-in-JS.html

@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<script src="../include.js"></script>
+<select id="select-test">
+    <option>A</option>
+    <option>B</option>
+</select>
+<script>
+    test(() => {
+        const s = document.getElementById("select-test");
+
+        s.options[1].selected = true;
+        if(s.value === "B") {
+            println("PASS");
+        }
+    });
+</script>