LibWeb: Update checkbox focus lost test

This commit is contained in:
Psychpsyo 2024-11-22 13:31:18 +01:00 committed by Tim Ledbetter
parent c75dda8f8b
commit 3f5fff79ae
Notes: github-actions[bot] 2024-11-22 13:59:35 +00:00
2 changed files with 10 additions and 2 deletions

View file

@ -0,0 +1 @@
PASS: Change event was not fired

View file

@ -2,8 +2,9 @@
<input type="checkbox" id="checkbox">
<script src="include.js"></script>
<script>
let changeEventFired = false;
checkbox.addEventListener("change", () => {
println("Change event was fired when it shouldn't have been.");
changeEventFired = true;
});
asyncTest(async done => {
checkbox.focus();
@ -11,6 +12,12 @@
checkbox.blur();
await new Promise(resolve => setTimeout(resolve, 0));
if (changeEventFired) {
println("FAIL: Change event was fired when it shouldn't have been.");
} else {
println("PASS: Change event was not fired");
}
done();
});
</script>
</script>