diff options
author | Samuel Mannehed <samuel@cendio.se> | 2021-12-10 17:53:47 +0100 |
---|---|---|
committer | Samuel Mannehed <samuel@cendio.se> | 2021-12-13 11:20:14 +0100 |
commit | acc30093ada1f69fdf9e98b1615c8139e6a3e42a (patch) | |
tree | f78b7aa3ea2904353d49741256375f9e39575785 | |
parent | c0d4dc8eb3654d4fd6e7fb6a955a48f56b6d1370 (diff) | |
download | novnc-acc30093ada1f69fdf9e98b1615c8139e6a3e42a.tar.gz |
Replace resize events with observations in tests
This was missed in commit 375f36c57544dd89c042a6beceff93a2430f2358,
probably because these unit tests still passed (due to the expectancy
was for the code to not act on the resize events).
-rw-r--r-- | tests/test.rfb.js | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/test.rfb.js b/tests/test.rfb.js index 3bde530..1685f81 100644 --- a/tests/test.rfb.js +++ b/tests/test.rfb.js @@ -553,8 +553,7 @@ describe('Remote Frame Buffer Protocol Client', function () { container.style.width = '40px'; container.style.height = '50px'; - const event = new UIEvent('resize'); - window.dispatchEvent(event); + fakeResizeObserver.fire(); clock.tick(); expect(client._display.viewportChangeSize).to.not.have.been.called; @@ -566,8 +565,7 @@ describe('Remote Frame Buffer Protocol Client', function () { container.style.width = '40px'; container.style.height = '50px'; - const event = new UIEvent('resize'); - window.dispatchEvent(event); + fakeResizeObserver.fire(); clock.tick(); expect(client._display.viewportChangeSize).to.not.have.been.called; @@ -748,8 +746,7 @@ describe('Remote Frame Buffer Protocol Client', function () { container.style.width = '40px'; container.style.height = '50px'; - const event = new UIEvent('resize'); - window.dispatchEvent(event); + fakeResizeObserver.fire(); clock.tick(); expect(client._display.autoscale).to.not.have.been.called; @@ -859,8 +856,7 @@ describe('Remote Frame Buffer Protocol Client', function () { container.style.width = '40px'; container.style.height = '50px'; - const event = new UIEvent('resize'); - window.dispatchEvent(event); + fakeResizeObserver.fire(); clock.tick(1000); expect(RFB.messages.setDesktopSize).to.not.have.been.called; @@ -871,8 +867,7 @@ describe('Remote Frame Buffer Protocol Client', function () { container.style.width = '40px'; container.style.height = '50px'; - const event = new UIEvent('resize'); - window.dispatchEvent(event); + fakeResizeObserver.fire(); clock.tick(1000); expect(RFB.messages.setDesktopSize).to.not.have.been.called; @@ -883,8 +878,7 @@ describe('Remote Frame Buffer Protocol Client', function () { container.style.width = '40px'; container.style.height = '50px'; - const event = new UIEvent('resize'); - window.dispatchEvent(event); + fakeResizeObserver.fire(); clock.tick(1000); expect(RFB.messages.setDesktopSize).to.not.have.been.called; |