File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2209,4 +2209,23 @@ describe('Parse.Query testing', () => {
2209
2209
} )
2210
2210
} )
2211
2211
2212
+ it ( 'query with two OR subqueries (regression test #1259)' , done => {
2213
+ let relatedObject = new Parse . Object ( 'Class2' ) ;
2214
+ relatedObject . save ( ) . then ( relatedObject => {
2215
+ let anObject = new Parse . Object ( 'Class1' ) ;
2216
+ let relation = anObject . relation ( 'relation' ) ;
2217
+ relation . add ( relatedObject ) ;
2218
+ return anObject . save ( ) ;
2219
+ } ) . then ( anObject => {
2220
+ let q1 = anObject . relation ( 'relation' ) . query ( ) ;
2221
+ q1 . doesNotExist ( 'nonExistantKey1' ) ;
2222
+ let q2 = anObject . relation ( 'relation' ) . query ( ) ;
2223
+ q2 . doesNotExist ( 'nonExistantKey2' ) ;
2224
+ let orQuery = Parse . Query . or ( q1 , q2 ) . find ( ) . then ( results => {
2225
+ expect ( results . length ) . toEqual ( 1 ) ;
2226
+ expect ( results [ 0 ] . objectId ) . toEqual ( q1 . objectId ) ;
2227
+ done ( ) ;
2228
+ } ) ;
2229
+ } ) ;
2230
+ } ) ;
2212
2231
} ) ;
You can’t perform that action at this time.
0 commit comments