mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
test(integration): add specs for the web fixtures
This commit is contained in:
1 parent
b8b3c9b8f7
commit
a3047a87f4
2 files changed
+24
No files matched your search
+18
@@ -0,0 +1,18 @@
|
||||
import { always, extract, taps } from "@sanderling/spec";
|
||||
|
||||
const counter = extract((s) => {
|
||||
const el = s.ax.find({ id: "counter" });
|
||||
return el ? parseInt(el.text, 10) || 0 : 0;
|
||||
}).named("counter");
|
||||
|
||||
// The + and - buttons each move the counter by exactly 1, so no step ever
|
||||
// changes it by more than 1. A bug that double-applied a click would break this.
|
||||
const changesByAtMostOne = always(() => {
|
||||
const previous = counter.previous;
|
||||
if (previous === undefined) return true;
|
||||
return Math.abs(counter.current - previous) <= 1;
|
||||
});
|
||||
|
||||
export const properties = { changesByAtMostOne };
|
||||
|
||||
export const actionsRoot = taps;
|
||||
@@ -0,0 +1,6 @@
|
||||
import { taps } from "@sanderling/spec";
|
||||
import { noUncaughtExceptions } from "@sanderling/spec/defaults/properties";
|
||||
|
||||
export const properties = { noUncaughtExceptions };
|
||||
|
||||
export const actionsRoot = taps;
|
||||
Reference in new issue
Block a user