Skip to content

Commit

Permalink
parse-community#8845 Unused test removed
Browse files Browse the repository at this point in the history
  • Loading branch information
onurhanife committed Jan 2, 2024
1 parent ef0c1a3 commit 5597d07
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions spec/ParseLiveQueryServer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,61 +1131,6 @@ describe('ParseLiveQueryServer', function () {
done();
});

xit('can deprecate fields', async () => {
const Deprecator = require('../lib/Deprecator/Deprecator');
const spy = spyOn(Deprecator, 'logRuntimeDeprecation').and.callFake(() => {});
jasmine.restoreLibrary('../lib/LiveQuery/Client', 'Client');
const Client = require('../lib/LiveQuery/Client').Client;
const parseLiveQueryServer = new ParseLiveQueryServer({});
// Make mock request message
const message = generateMockMessage();

const clientId = 1;
const parseWebSocket = {
clientId,
send: jasmine.createSpy('send'),
};
const client = new Client(clientId, parseWebSocket);
spyOn(client, 'pushCreate').and.callThrough();
parseLiveQueryServer.clients.set(clientId, client);

// Add mock subscription
const requestId = 2;
const query = {
className: testClassName,
where: {
key: 'value',
},
fields: ['test'],
};
await addMockSubscription(parseLiveQueryServer, clientId, requestId, parseWebSocket, query);
// Mock _matchesSubscription to return matching
parseLiveQueryServer._matchesSubscription = function (parseObject) {
if (!parseObject) {
return false;
}
return true;
};
parseLiveQueryServer._matchesACL = function () {
return Promise.resolve(true);
};

parseLiveQueryServer._onAfterSave(message);

// Make sure we send create command to client
await timeout();

expect(client.pushCreate).toHaveBeenCalled();
const args = parseWebSocket.send.calls.mostRecent().args;
const toSend = JSON.parse(args[0]);
expect(toSend.object).toBeDefined();
expect(toSend.original).toBeUndefined();
expect(spy).toHaveBeenCalledWith({
usage: 'Subscribing using fields parameter',
solution: `Subscribe using "keys" instead.`,
});
});

it('can handle create command with watch', async () => {
jasmine.restoreLibrary('../lib/LiveQuery/Client', 'Client');
const Client = require('../lib/LiveQuery/Client').Client;
Expand Down

0 comments on commit 5597d07

Please sign in to comment.