@@ -213,7 +213,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
213213 } ) ;
214214 } ) ;
215215
216- fit ( 'upserts with $setOnInsert' , async ( ) => {
216+ it ( 'upserts with $setOnInsert' , async ( ) => {
217217 const uuid = require ( 'uuid' ) ;
218218 const uuid1 = uuid . v4 ( ) ;
219219 const uuid2 = uuid . v4 ( ) ;
@@ -223,7 +223,13 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
223223 x : { type : 'Number' } ,
224224 count : { type : 'Number' } ,
225225 } ,
226+ classLevelPermissions : { } ,
226227 } ;
228+
229+ const myClassSchema = new Parse . Schema ( schema . className ) ;
230+ myClassSchema . setCLP ( schema . classLevelPermissions ) ;
231+ await myClassSchema . save ( ) ;
232+
227233 const query = {
228234 x : 1 ,
229235 } ;
@@ -250,18 +256,16 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
250256 update ,
251257 { upsert : true } ,
252258 ) ;
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 ) ;
265269 } ) ;
266270
267271 it ( 'handles updating a single object with array, object date' , done => {
0 commit comments