File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,35 @@ describe('matchesQuery', function () {
125
125
expect ( matchesQuery ( obj , q ) ) . toBe ( false ) ;
126
126
} ) ;
127
127
128
+ it ( 'matches queries with eq constraint' , function ( ) {
129
+ const obj = {
130
+ objectId : 'Person2' ,
131
+ score : 12 ,
132
+ name : 'Tom' ,
133
+ } ;
134
+
135
+ const q1 = {
136
+ objectId : {
137
+ $eq : 'Person2' ,
138
+ } ,
139
+ } ;
140
+
141
+ const q2 = {
142
+ score : {
143
+ $eq : 12 ,
144
+ } ,
145
+ } ;
146
+
147
+ const q3 = {
148
+ name : {
149
+ $eq : 'Tom' ,
150
+ } ,
151
+ } ;
152
+ expect ( matchesQuery ( obj , q1 ) ) . toBe ( true ) ;
153
+ expect ( matchesQuery ( obj , q2 ) ) . toBe ( true ) ;
154
+ expect ( matchesQuery ( obj , q3 ) ) . toBe ( true ) ;
155
+ } ) ;
156
+
128
157
it ( 'matches on equality queries' , function ( ) {
129
158
const day = new Date ( ) ;
130
159
const location = new Parse . GeoPoint ( {
You can’t perform that action at this time.
0 commit comments