LibWeb: Update checkbox focus lost test
This commit is contained in:
parent
c75dda8f8b
commit
3f5fff79ae
Notes:
github-actions[bot]
2024-11-22 13:59:35 +00:00
Author: https://github.com/Psychpsyo Commit: https://github.com/LadybirdBrowser/ladybird/commit/3f5fff79ae0 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2501 Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 10 additions and 2 deletions
|
@ -0,0 +1 @@
|
|||
PASS: Change event was not fired
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue