diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-checkbox-switch.tentative.window.js')
-rw-r--r-- | testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-checkbox-switch.tentative.window.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-checkbox-switch.tentative.window.js b/testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-checkbox-switch.tentative.window.js new file mode 100644 index 0000000000..6128a62a0f --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/input-type-checkbox-switch.tentative.window.js @@ -0,0 +1,19 @@ +test(t => { + const input = document.createElement("input"); + input.switch = true; + + assert_true(input.hasAttribute("switch")); + assert_equals(input.getAttribute("switch"), ""); + assert_equals(input.type, "text"); +}, "switch IDL attribute, setter"); + +test(t => { + const container = document.createElement("div"); + container.innerHTML = "<input type=checkbox switch>"; + const input = container.firstChild; + + assert_true(input.hasAttribute("switch")); + assert_equals(input.getAttribute("switch"), ""); + assert_equals(input.type, "checkbox"); + assert_true(input.switch); +}, "switch IDL attribute, getter"); |