@@ -52,7 +52,7 @@ const fullTextHelper = () => {
52
52
} ) ;
53
53
} ;
54
54
55
- describe ( 'Parse.Query Full Text Search testing' , ( ) => {
55
+ fdescribe ( 'Parse.Query Full Text Search testing' , ( ) => {
56
56
it ( 'fullTextSearch: $search' , done => {
57
57
fullTextHelper ( )
58
58
. then ( ( ) => {
@@ -122,11 +122,31 @@ describe('Parse.Query Full Text Search testing', () => {
122
122
123
123
it ( 'fulltext descending by $score' , async ( ) => {
124
124
await fullTextHelper ( ) ;
125
- const query = new Parse . Query ( 'TestObject' ) ;
126
- query . fullText ( 'subject' , 'coffee' ) ;
127
- query . descending ( '$score' ) ;
128
- const objects = await query . find ( ) ;
129
- expect ( objects . length ) . toBe ( 3 ) ;
125
+ const where = {
126
+ subject : {
127
+ $text : {
128
+ $search : {
129
+ $term : 'coffee' ,
130
+ } ,
131
+ } ,
132
+ } ,
133
+ } ;
134
+ const order = '-$score' ;
135
+ const keys = '$score' ;
136
+ const { data } = await request ( {
137
+ method : 'POST' ,
138
+ url : 'http://localhost:8378/1/classes/TestObject' ,
139
+ body : { where, order, keys, _method : 'GET' } ,
140
+ headers : {
141
+ 'X-Parse-Application-Id' : 'test' ,
142
+ 'X-Parse-REST-API-Key' : 'test' ,
143
+ 'Content-Type' : 'application/json' ,
144
+ } ,
145
+ } ) ;
146
+ expect ( data . results . length ) . toBe ( 3 ) ;
147
+ expect ( data . results [ 0 ] . score ) ;
148
+ expect ( data . results [ 1 ] . score ) ;
149
+ expect ( data . results [ 2 ] . score ) ;
130
150
} ) ;
131
151
132
152
it ( 'fullTextSearch: $language' , done => {
0 commit comments