Fix last rect test

Avoid poking in to internals and instead test that the RFB object
responds correctly to new messages.
This commit is contained in:
Pierre Ossman 2023-05-22 13:05:10 +02:00
parent 549ccc7121
commit 13fa6b5908
1 changed files with 5 additions and 1 deletions

View File

@ -2873,7 +2873,11 @@ describe('Remote Frame Buffer Protocol Client', function () {
it('should handle the last_rect pseudo-encoding', function () {
sendFbuMsg([{ x: 0, y: 0, width: 0, height: 0, encoding: -224}], [[]], client, 100);
expect(client._FBU.rects).to.equal(0);
// Send a bell message and make sure it is parsed
let spy = sinon.spy();
client.addEventListener("bell", spy);
client._sock._websocket._receiveData(new Uint8Array([0x02]));
expect(spy).to.have.been.calledOnce;
});
it('should handle the DesktopName pseudo-encoding', function () {