Skip to content

Commit d2a5641

Browse files
authored
Test Case for #1184 (#1203)
1 parent 2230072 commit d2a5641

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

integration/test/ParseLiveQueryTest.js

+19
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,23 @@ describe('Parse LiveQuery', () => {
221221
done();
222222
})
223223
});
224+
225+
it('can subscribe to query with fields', async (done) => {
226+
const object = new TestObject();
227+
await object.save({ name: 'hello', age: 21 });
228+
229+
const query = new Parse.Query(TestObject);
230+
query.equalTo('objectId', object.id);
231+
query.select(['name']);
232+
const subscription = await query.subscribe();
233+
234+
subscription.on('update', (object) => {
235+
assert.equal(object.get('name'), 'hello');
236+
assert.equal(object.get('age'), undefined)
237+
assert.equal(object.get('foo'), undefined);
238+
done();
239+
})
240+
object.set({ foo: 'bar' });
241+
await object.save();
242+
});
224243
});

0 commit comments

Comments
 (0)