Skip to content

Commit

Permalink
fix: test of connection
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Feb 25, 2025
1 parent 3633b3d commit a9a91da
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ describe('WebSocketTcpClientDevice', () => {
MockWebSocketTcpConnection.prototype.connected.mockReturnValue(true)
expect(device.getStatus()).toEqual({
statusCode: StatusCode.GOOD,
messages: ["Connected"],
})

MockWebSocketTcpConnection.prototype.connected.mockReturnValue(false)
expect(device.getStatus()).toEqual({
statusCode: StatusCode.BAD,
messages: ["Disconnected"],
})
})
})
Expand Down Expand Up @@ -129,6 +131,7 @@ describe('WebSocketTcpClientDevice', () => {

const commands = device.diffStates(oldState, newState)


expect(commands).toHaveLength(1)
expect(commands[0].command.type).toBe(TimelineContentTypeWebSocketTcpClient.WEBSOCKET_MESSAGE)
expect(commands[0].command.message).toBe('new test ws message state')
Expand Down

0 comments on commit a9a91da

Please sign in to comment.