Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions integration/test/ParseLiveQueryTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ describe('Parse LiveQuery', () => {
it('can subscribe to query', async (done) => {
const object = new TestObject();
await object.save();
const installationId = await Parse.CoreManager.getInstallationController().currentInstallationId();

const query = new Parse.Query(TestObject);
query.equalTo('objectId', object.id);
const subscription = await query.subscribe();

subscription.on('update', object => {
subscription.on('update', (object, original, response) => {
assert.equal(object.get('foo'), 'bar');
assert.equal(response.installationId, installationId);
done();
})
object.set({ foo: 'bar' });
Expand All @@ -36,6 +38,7 @@ describe('Parse LiveQuery', () => {
it('can subscribe to query with client', async (done) => {
const object = new TestObject();
await object.save();
const installationId = await Parse.CoreManager.getInstallationController().currentInstallationId();

const query = new Parse.Query(TestObject);
query.equalTo('objectId', object.id);
Expand All @@ -45,8 +48,9 @@ describe('Parse LiveQuery', () => {
}
const subscription = client.subscribe(query);

subscription.on('update', object => {
subscription.on('update', (object, original, response) => {
assert.equal(object.get('foo'), 'bar');
assert.equal(response.installationId, installationId);
done();
});
await subscription.subscribePromise;
Expand Down
Loading