From 13fa6b5908c84cf53ec27252e83709df3e0b48c9 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 22 May 2023 13:05:10 +0200 Subject: [PATCH] Fix last rect test Avoid poking in to internals and instead test that the RFB object responds correctly to new messages. --- tests/test.rfb.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test.rfb.js b/tests/test.rfb.js index bd91e3c9..8cb29bed 100644 --- a/tests/test.rfb.js +++ b/tests/test.rfb.js @@ -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 () {