@@ -213,7 +213,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
213
213
} ) ;
214
214
} ) ;
215
215
216
- fit ( 'upserts with $setOnInsert' , async ( ) => {
216
+ it ( 'upserts with $setOnInsert' , async ( ) => {
217
217
const uuid = require ( 'uuid' ) ;
218
218
const uuid1 = uuid . v4 ( ) ;
219
219
const uuid2 = uuid . v4 ( ) ;
@@ -223,7 +223,13 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
223
223
x : { type : 'Number' } ,
224
224
count : { type : 'Number' } ,
225
225
} ,
226
+ classLevelPermissions : { } ,
226
227
} ;
228
+
229
+ const myClassSchema = new Parse . Schema ( schema . className ) ;
230
+ myClassSchema . setCLP ( schema . classLevelPermissions ) ;
231
+ await myClassSchema . save ( ) ;
232
+
227
233
const query = {
228
234
x : 1 ,
229
235
} ;
@@ -250,18 +256,16 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
250
256
update ,
251
257
{ upsert : true } ,
252
258
) ;
253
- // const res = await Parse.Server.database.find(
254
- // schema.className,
255
- // schema,
256
- // {},
257
- // {},
258
- // );
259
- // const q = new Parse.Query('MyClass');
260
- // const docs = await q.find();
261
- // expect(docs.length).toBe(1);
262
- // expect(docs[0].id).toBe(uuid1);
263
- // expect(docs[0].get('x')).toBe(1);
264
- // expect(docs[0].get('count')).toBe(2);
259
+
260
+ const res = await Parse . Server . database . find (
261
+ schema . className ,
262
+ { } ,
263
+ { } ,
264
+ ) ;
265
+ expect ( res . length ) . toBe ( 1 ) ;
266
+ expect ( res [ 0 ] . objectId ) . toBe ( uuid1 ) ;
267
+ expect ( res [ 0 ] . count ) . toBe ( 2 ) ;
268
+ expect ( res [ 0 ] . x ) . toBe ( 1 ) ;
265
269
} ) ;
266
270
267
271
it ( 'handles updating a single object with array, object date' , done => {
0 commit comments