Skip to content

Commit

Permalink
Bug 1658748 [wpt PR 24975] - Add tests for disabled input clicks, a=t…
Browse files Browse the repository at this point in the history
…estonly

Automatic update from web-platform-tests
Add tests for disabled input clicks

See whatwg/html#5805; this tests the scenario there plus others.
--

wpt-commits: ed728bc7b01fed9c0cf7f4794d592fb2f1e151fa
wpt-pr: 24975
  • Loading branch information
saschanaz authored and moz-wptsync-bot committed Aug 25, 2020
1 parent ecbc015 commit 16f6ab8
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions testing/web-platform/tests/dom/events/Event-dispatch-click.html
Expand Up @@ -209,6 +209,38 @@
input.dispatchEvent(new MouseEvent('click'));
}, `disconnected radio should be checked from dispatchEvent(new MouseEvent('click'))`);

test(() => {
const input = document.createElement("input");
input.type = "checkbox";
input.disabled = true;
input.dispatchEvent(new MouseEvent("click"));
assert_true(input.checked);
}, `disabled checkbox should be checked from dispatchEvent(new MouseEvent("click"))`);

test(() => {
const input = document.createElement("input");
input.type = "radio";
input.disabled = true;
input.dispatchEvent(new MouseEvent("click"));
assert_true(input.checked);
}, `disabled radio should be checked from dispatchEvent(new MouseEvent("click"))`);

async_test(t => {
const input = document.createElement("input");
input.type = "checkbox";
input.disabled = true;
input.onclick = t.step_func_done();
input.dispatchEvent(new MouseEvent("click"));
}, `disabled checkbox should fire onclick`);

async_test(t => {
const input = document.createElement("input");
input.type = "radio";
input.disabled = true;
input.onclick = t.step_func_done();
input.dispatchEvent(new MouseEvent("click"));
}, `disabled radio should fire onclick`);

async_test(function(t) {
var form = document.createElement("form")
var didSubmit = false
Expand Down

0 comments on commit 16f6ab8

Please sign in to comment.