File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -3086,4 +3086,27 @@ describe('Parse.Query testing', () => {
3086
3086
done ( ) ;
3087
3087
} , done . fail ) ;
3088
3088
} ) ;
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
+ } ) ;
3089
3112
} ) ;
You can’t perform that action at this time.
0 commit comments