]> git.proxmox.com Git - mirror_novnc.git/blobdiff - tests/test.websock.js
Don't fake open events in Websock
[mirror_novnc.git] / tests / test.websock.js
index 1c2aa13c74763c863175766ceb16d68296e85107..857fdca805957bed08940e04b32fc0106d08789e 100644 (file)
@@ -271,23 +271,10 @@ describe('Websock', function () {
         });
 
         describe('attaching', function () {
-            it('should attach to an existing open websocket', function () {
+            it('should attach to an existing websocket', function () {
                 let ws = new FakeWebSocket('ws://localhost:8675');
-                ws._open();
-                let callback = sinon.spy();
-                sock.on('open', callback);
                 sock.attach(ws);
                 expect(WebSocket).to.not.have.been.called;
-                expect(callback).to.have.been.calledOnce;
-            });
-
-            it('should attach to an existing connecting websocket', function () {
-                let ws = new FakeWebSocket('ws://localhost:8675');
-                let callback = sinon.spy();
-                sock.on('open', callback);
-                sock.attach(ws);
-                expect(WebSocket).to.not.have.been.called;
-                expect(callback).to.not.have.been.called;
             });
         });