Skip to content

Commit 0301810

Browse files
kfuledead-claudia
authored andcommitted
add manual rendering tests
1 parent 4025c1c commit 0301810

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
</head>
6+
<body>
7+
This is minlength validity test (#2256).
8+
Open your browser's Developer Console and follow these steps:
9+
<ol>
10+
<li>Type any (1 or 2) characters in the input field.</li>
11+
<li>Click “submit.”</li>
12+
<li>Click “submit” again.</li>
13+
<li>Check the logs displayed in the console.</li>
14+
</ol>
15+
16+
<div id="root"></div>
17+
<script src="../../../mithril.js"></script>
18+
<script>
19+
let input, value;
20+
21+
m.mount(document.getElementById("root"), {
22+
view: () => [
23+
input = m("input[type=text]", {
24+
value,
25+
minLength: 4,
26+
required: true,
27+
oninput(e) {
28+
value = e.target.value;
29+
check();
30+
}
31+
}),
32+
m("button", {
33+
onclick(e) {
34+
console.log("click");
35+
check();
36+
}
37+
}, "submit")
38+
],
39+
});
40+
41+
function check() {
42+
console.log(`tooShort: ${input.dom.validity.tooShort}`,
43+
`valueMissing: ${input.dom.validity.valueMissing}`,
44+
`checkValidity: ${input.dom.checkValidity()}`
45+
);
46+
}
47+
</script>
48+
</body>
49+
</html>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
</head>
6+
<body>
7+
This is minlength validity test (#2256).
8+
Open your browser's Developer Console and follow these steps:
9+
<ol>
10+
<li>Type any (1 or 2) characters in the textarea field.</li>
11+
<li>Click “submit.”</li>
12+
<li>Click “submit” again.</li>
13+
<li>Check the logs displayed in the console.</li>
14+
</ol>
15+
16+
<div id="root"></div>
17+
<script src="../../../mithril.js"></script>
18+
<script>
19+
let input, value;
20+
21+
m.mount(document.getElementById("root"), {
22+
view: () => [
23+
input = m("textarea", {
24+
value,
25+
minLength: 4,
26+
required: true,
27+
oninput(e) {
28+
value = e.target.value;
29+
check();
30+
}
31+
}),
32+
m("button", {
33+
onclick(e) {
34+
console.log("click");
35+
check();
36+
}
37+
}, "submit")
38+
],
39+
});
40+
41+
function check() {
42+
console.log(`tooShort: ${input.dom.validity.tooShort}`,
43+
`valueMissing: ${input.dom.validity.valueMissing}`,
44+
`checkValidity: ${input.dom.checkValidity()}`
45+
);
46+
}
47+
</script>
48+
</body>
49+
</html>

0 commit comments

Comments
 (0)