|
1 | | -import { WebSocket } from 'mock-socket'; |
2 | 1 | import { WebSocketSession } from '../../src/communication/WebSocketSession'; |
3 | 2 |
|
4 | 3 | describe('Test xcSession module', function() { |
5 | 4 | describe('Add private topic / SetPrivateTopic', function() { |
6 | 5 | it('should not trigger server subscription on undefined topic', () => { |
7 | 6 | // tslint:disable-next-line:no-any |
8 | 7 | let mockWebSocket: any = {}; |
| 8 | + // tslint:disable-next-line:no-any |
| 9 | + let apiConfiguration: any = {}; |
9 | 10 | mockWebSocket.send = jest.fn(); |
10 | 11 | mockWebSocket.getObservable = jest.fn(); |
11 | | - const session = new WebSocketSession(mockWebSocket, null); |
| 12 | + const session = new WebSocketSession(mockWebSocket, apiConfiguration); |
12 | 13 | session.privateTopics.setDefaultPublisherTopic(undefined); |
13 | 14 | session.privateTopics.addSubscriberTopic(undefined); |
14 | 15 | expect(mockWebSocket.send).toHaveBeenCalledTimes(1); |
15 | 16 | }); |
16 | 17 |
|
17 | 18 | it('Should add and set correctly the given private topics', () => { |
18 | | - const serverUrl = 'wss:\\serverUrl'; |
19 | 19 | // tslint:disable-next-line:no-any |
20 | 20 | let mockWebSocket: any = {}; |
| 21 | + // tslint:disable-next-line:no-any |
| 22 | + let apiConfiguration: any = {}; |
21 | 23 | mockWebSocket.send = jest.fn(); |
22 | 24 | mockWebSocket.getObservable = jest.fn(); |
23 | | - const session = new WebSocketSession(mockWebSocket, null); |
| 25 | + const session = new WebSocketSession(mockWebSocket, apiConfiguration); |
24 | 26 | const privateTopic = 'privateTopic'; |
25 | 27 | const anotherPrivateTopic = 'anotherPrivateTopic'; |
26 | 28 | session.privateTopics.setDefaultPublisherTopic(privateTopic); |
|
0 commit comments