summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/disabled-elements/disabled-checkbox-click.html
blob: 805770c8543842610499fa11e329c17b34cd03c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!doctype html>
<link rel="author" title="Aditya Keerthi" href="https://github.com/pxlcoder">
<link rel="help" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute">
<title>Test disabled checkbox does not change state when clicked</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>

<input type="checkbox" disabled>
<script>
const input = document.querySelector("input");

promise_test(async function() {
    assert_false(input.checked);

    await new test_driver.Actions()
        .pointerMove(0, 0, { origin: input })
        .pointerDown()
        .pointerUp()
        .send();

    assert_false(input.checked);
}, `Disabled checkbox does not change state when clicked`);
</script>