mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-02-24 06:11:04 +01:00
Make clipBoardPasteFrom() test more specific
Don't rely on clientCutText() to test clipboardPasteFrom().
This commit is contained in:
parent
d01f6e6d27
commit
24cf1f0f9a
@ -291,12 +291,18 @@ describe('Remote Frame Buffer Protocol Client', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('#clipboardPasteFrom', function () {
|
describe('#clipboardPasteFrom', function () {
|
||||||
|
beforeEach(function () {
|
||||||
|
sinon.spy(RFB.messages, 'clientCutText');
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(function () {
|
||||||
|
RFB.messages.clientCutText.restore();
|
||||||
|
});
|
||||||
|
|
||||||
it('should send the given text in a paste event', function () {
|
it('should send the given text in a paste event', function () {
|
||||||
const expected = {_sQ: new Uint8Array(11), _sQlen: 0,
|
|
||||||
_sQbufferSize: 11, flush: () => {}};
|
|
||||||
RFB.messages.clientCutText(expected, 'abc');
|
|
||||||
client.clipboardPasteFrom('abc');
|
client.clipboardPasteFrom('abc');
|
||||||
expect(client._sock).to.have.sent(expected._sQ);
|
expect(RFB.messages.clientCutText).to.have.been.calledOnce;
|
||||||
|
expect(RFB.messages.clientCutText).to.have.been.calledWith(client._sock, 'abc');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should flush multiple times for large clipboards', function () {
|
it('should flush multiple times for large clipboards', function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user