mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
Tests/LibWeb: Verify dialog return value is correct in dialog test
This commit is contained in:
parent
88fe236c77
commit
f5266e0096
2 changed files with 6 additions and 3 deletions
|
@ -1,2 +1,4 @@
|
||||||
dialog.open before form submit: true
|
dialog.open before form submit: true
|
||||||
|
dialog.returnValue before form submit should be empty: true
|
||||||
dialog.open after form submit: false
|
dialog.open after form submit: false
|
||||||
|
dialog.returnValue after form submit: PASS
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script src="./include.js"></script>
|
<script src="./include.js"></script>
|
||||||
<dialog id="test-dialog" open>
|
<dialog id="test-dialog" open>
|
||||||
<form method="dialog">
|
<form method="dialog">
|
||||||
<button id="submit-button">Submit</button>
|
<button id="submit-button" value="PASS">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
</dialog>
|
</dialog>
|
||||||
<script>
|
<script>
|
||||||
|
@ -10,8 +10,9 @@
|
||||||
const submitter = document.getElementById("submit-button");
|
const submitter = document.getElementById("submit-button");
|
||||||
const form = document.forms[0];
|
const form = document.forms[0];
|
||||||
println(`dialog.open before form submit: ${dialog.open}`);
|
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.open after form submit: ${dialog.open}`);
|
||||||
|
println(`dialog.returnValue after form submit: ${dialog.returnValue}`);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue