Tests/LibWeb: Verify dialog return value is correct in dialog test
This commit is contained in:
parent
88fe236c77
commit
f5266e0096
Notes:
sideshowbarker
2024-07-17 21:26:19 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/f5266e0096 Pull-request: https://github.com/SerenityOS/serenity/pull/23204 Reviewed-by: https://github.com/trflynn89 ✅
2 changed files with 6 additions and 3 deletions
|
@ -1,2 +1,4 @@
|
|||
dialog.open before form submit: true
|
||||
dialog.returnValue before form submit should be empty: true
|
||||
dialog.open after form submit: false
|
||||
dialog.returnValue after form submit: PASS
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script src="./include.js"></script>
|
||||
<dialog id="test-dialog" open>
|
||||
<form method="dialog">
|
||||
<button id="submit-button">Submit</button>
|
||||
<button id="submit-button" value="PASS">Submit</button>
|
||||
</form>
|
||||
</dialog>
|
||||
<script>
|
||||
|
@ -10,8 +10,9 @@
|
|||
const submitter = document.getElementById("submit-button");
|
||||
const form = document.forms[0];
|
||||
println(`dialog.open before form submit: ${dialog.open}`);
|
||||
form.submit();
|
||||
println(`dialog.returnValue before form submit should be empty: ${dialog.returnValue === ""}`);
|
||||
form.requestSubmit(submitter);
|
||||
println(`dialog.open after form submit: ${dialog.open}`);
|
||||
|
||||
println(`dialog.returnValue after form submit: ${dialog.returnValue}`);
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Reference in a new issue