All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 32s
16 lines
706 B
JavaScript
16 lines
706 B
JavaScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { swipeStep } from "../shared/navigation.js";
|
|
|
|
test("phone swipes accept deliberate travel and short fast flicks in both directions", () => {
|
|
assert.equal(swipeStep(-100, 8, 500, 393), 1);
|
|
assert.equal(swipeStep(100, -8, 500, 393), -1);
|
|
assert.equal(swipeStep(-40, 2, 65, 393), 1);
|
|
assert.equal(swipeStep(60, 0, 500, 320), -1);
|
|
});
|
|
test("scrolling, diagonal travel, slow small movements and jitter never switch tabs", () => {
|
|
assert.equal(swipeStep(12, 150, 250, 393), 0);
|
|
assert.equal(swipeStep(100, 100, 150, 393), 0);
|
|
assert.equal(swipeStep(40, 2, 500, 393), 0);
|
|
assert.equal(swipeStep(8, 0, 5, 393), 0);
|
|
});
|