diff --git a/internal/integration/testdata/counter/spec.ts b/internal/integration/testdata/counter/spec.ts new file mode 100644 index 0000000..64cdeb4 --- /dev/null +++ b/internal/integration/testdata/counter/spec.ts @@ -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; diff --git a/internal/integration/testdata/throwing/spec.ts b/internal/integration/testdata/throwing/spec.ts new file mode 100644 index 0000000..4803b81 --- /dev/null +++ b/internal/integration/testdata/throwing/spec.ts @@ -0,0 +1,6 @@ +import { taps } from "@sanderling/spec"; +import { noUncaughtExceptions } from "@sanderling/spec/defaults/properties"; + +export const properties = { noUncaughtExceptions }; + +export const actionsRoot = taps;