Polish PWA gestures, transitions and nutrition averages
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 32s
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 32s
This commit is contained in:
parent
b19de6f9ea
commit
7288e56c02
16 changed files with 1019 additions and 245 deletions
16
tests/navigation.test.js
Normal file
16
tests/navigation.test.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
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);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue