feat: publish CodexPi contest snapshot
Some checks are pending
Qualité / tests (push) Waiting to run
Some checks are pending
Qualité / tests (push) Waiting to run
This commit is contained in:
18
frontend/tests/browserTouchpad.test.ts
Normal file
18
frontend/tests/browserTouchpad.test.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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},
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user