Adding tests by mocking jQuery.ajax and window.WebSocket.