Add unit test for wheel + buttons pressed

This commit is contained in:
Adam Halim 2025-01-10 14:22:14 +01:00
parent 7a4d1a8274
commit de9d6888db
1 changed files with 15 additions and 0 deletions

View File

@ -3964,6 +3964,21 @@ describe('Remote Frame Buffer protocol client', function () {
expect(pointerEvent.secondCall).to.have.been.calledWith(client._sock, expect(pointerEvent.secondCall).to.have.been.calledWith(client._sock,
10, 10, 0); 10, 10, 0);
}); });
it('should handle wheel event with buttons pressed', function () {
sendMouseButtonEvent(10, 10, true, 0, client);
sendWheelEvent(10, 10, 0, 50);
expect(pointerEvent).to.have.been.called.calledThrice;
expect(pointerEvent.firstCall).to.have.been.calledWith(client._sock,
10, 10, 0x1);
expect(pointerEvent.secondCall).to.have.been.calledWith(client._sock,
10, 10, 0x11);
expect(pointerEvent.thirdCall).to.have.been.calledWith(client._sock,
10, 10, 0x1);
});
}); });
describe('Keyboard events', function () { describe('Keyboard events', function () {