Skip to content

Commit e0341dd

Browse files
author
Promise Xu
committed
Fail test case for Issue#3999
1 parent 0334370 commit e0341dd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

spec/ParseQuery.spec.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3086,4 +3086,27 @@ describe('Parse.Query testing', () => {
30863086
done();
30873087
}, done.fail);
30883088
});
3089+
3090+
it('should not interfere with has when using select on field with undefined value #3999', (done) => {
3091+
const obj1 = new Parse.Object('TestObject');
3092+
const obj2 = new Parse.Object('OtherObject');
3093+
obj2.set('otherField', 'ok');
3094+
obj1.set('testPointerField', obj2);
3095+
obj1.set('shouldBe', true);
3096+
const obj3 = new Parse.Object('TestObject');
3097+
obj3.set('shouldBe', false);
3098+
Parse.Object.saveAll([obj1, obj3]).then(() => {
3099+
const query = new Parse.Query('TestObject');
3100+
query.include('testPointerField');
3101+
query.select(['testPointerField', 'testPointerField.otherField', 'shouldBe']);
3102+
return query.find();
3103+
}).then(results => {
3104+
results.forEach(result => {
3105+
console.log('result: ' + JSON.stringify(result));
3106+
equal(result.has('testPointerField'), result.get('shouldBe'));
3107+
});
3108+
done();
3109+
}
3110+
).catch(done.fail);
3111+
});
30893112
});

0 commit comments

Comments
 (0)