Improve Live Query Monitoring (#5927)

* Improve Live Query Monitoring

* typo
This commit is contained in:
Diamond Lewis
2019-08-16 13:38:24 -05:00
committed by Antonio Davi Macedo Coelho de Castro
parent cea1988ce9
commit 3ab9dcdfd0
5 changed files with 37 additions and 6 deletions

View File

@@ -293,7 +293,9 @@ describe('ParseLiveQueryServer', function() {
parseLiveQueryServer._validateKeys = jasmine
.createSpy('validateKeys')
.and.returnValue(true);
parseLiveQueryServer._handleConnect(parseWebSocket);
parseLiveQueryServer._handleConnect(parseWebSocket, {
sessionToken: 'token',
});
const clientKeys = parseLiveQueryServer.clients.keys();
expect(parseLiveQueryServer.clients.size).toBe(1);
@@ -335,6 +337,7 @@ describe('ParseLiveQueryServer', function() {
query: query,
requestId: requestId,
sessionToken: 'sessionToken',
installationId: 'installationId',
};
parseLiveQueryServer._handleSubscribe(parseWebSocket, request);
@@ -357,6 +360,7 @@ describe('ParseLiveQueryServer', function() {
expect(args[0]).toBe(requestId);
expect(args[1].fields).toBe(query.fields);
expect(args[1].sessionToken).toBe(request.sessionToken);
expect(args[1].installationId).toBe(request.installationId);
// Make sure we send subscribe response to the client
expect(client.pushSubscribe).toHaveBeenCalledWith(requestId);
});