Skip to content

Issue3999 #4245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
22 changes: 22 additions & 0 deletions spec/ParseQuery.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3086,4 +3086,26 @@ describe('Parse.Query testing', () => {
done();
}, done.fail);
});

it('should not interfere with has when using select on field with undefined value #3999', (done) => {
const obj1 = new Parse.Object('TestObject');
const obj2 = new Parse.Object('OtherObject');
obj2.set('otherField', 1);
obj1.set('testPointerField', obj2);
obj1.set('shouldBe', true);
const obj3 = new Parse.Object('TestObject');
obj3.set('shouldBe', false);
Parse.Object.saveAll([obj1, obj3]).then(() => {
const query = new Parse.Query('TestObject');
query.include('testPointerField');
query.select(['testPointerField', 'testPointerField.otherField', 'shouldBe']);
return query.find();
}).then(results => {
results.forEach(result => {
equal(result.has('testPointerField'), result.get('shouldBe'));
});
done();
}
).catch(done.fail);
});
});