Files
codexpi/frontend/tests/browserTouchpad.test.ts
CodexPi 995b17a6e2
Some checks are pending
Qualité / tests (push) Waiting to run
feat: publish CodexPi contest snapshot
2026-11-14 20:23:59 +01:00

19 lines
525 B
TypeScript

import assert from 'node:assert/strict'
import test from 'node:test'
import { relativePointerPosition } from '../public/browser-touchpad-math.js'
test('trackpad movement is relative to the current pointer position',()=>{
assert.deepEqual(
relativePointerPosition({x:320,y:180},40,-20,2,2,1.35,1440,900),
{x:428,y:126},
)
})
test('relative trackpad movement stays inside the remote screen',()=>{
assert.deepEqual(
relativePointerPosition({x:1430,y:5},100,-100,1,1,1.35,1440,900),
{x:1439,y:0},
)
})