mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-03 03:27:10 +00:00
test(integration): add throwing and counter web fixtures
This commit is contained in:
1 parent
f26ede7151
commit
b8b3c9b8f7
2 files changed
+48
No files matched your search
@@ -0,0 +1,27 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>counter</title>
|
||||
</head>
|
||||
<body>
|
||||
<button id="decrement">-</button>
|
||||
<div id="counter">0</div>
|
||||
<button id="increment">+</button>
|
||||
<script>
|
||||
let value = 0;
|
||||
const display = document.getElementById("counter");
|
||||
function render() {
|
||||
display.textContent = String(value);
|
||||
}
|
||||
document.getElementById("increment").addEventListener("click", function () {
|
||||
value += 1;
|
||||
render();
|
||||
});
|
||||
document.getElementById("decrement").addEventListener("click", function () {
|
||||
value -= 1;
|
||||
render();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>throwing</title>
|
||||
</head>
|
||||
<body>
|
||||
<button id="press">press</button>
|
||||
<div id="count">0</div>
|
||||
<script>
|
||||
let presses = 0;
|
||||
document.getElementById("press").addEventListener("click", function () {
|
||||
presses += 1;
|
||||
document.getElementById("count").textContent = String(presses);
|
||||
if (presses >= 3) {
|
||||
throw new Error("pressed too many times");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user