Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrezza committed Oct 25, 2023
1 parent d788f84 commit 468fc2a
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions spec/MongoStorageAdapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
});
});

fit('upserts with $setOnInsert', async () => {
it('upserts with $setOnInsert', async () => {
const uuid = require('uuid');
const uuid1 = uuid.v4();
const uuid2 = uuid.v4();
Expand All @@ -223,7 +223,13 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
x: { type: 'Number' },
count: { type: 'Number' },
},
classLevelPermissions: {},
};

const myClassSchema = new Parse.Schema(schema.className);
myClassSchema.setCLP(schema.classLevelPermissions);
await myClassSchema.save();

const query = {
x: 1,
};
Expand All @@ -250,18 +256,16 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {
update,
{ upsert: true },
);
// const res = await Parse.Server.database.find(
// schema.className,
// schema,
// {},
// {},
// );
// const q = new Parse.Query('MyClass');
// const docs = await q.find();
// expect(docs.length).toBe(1);
// expect(docs[0].id).toBe(uuid1);
// expect(docs[0].get('x')).toBe(1);
// expect(docs[0].get('count')).toBe(2);

const res = await Parse.Server.database.find(
schema.className,
{},
{},
);
expect(res.length).toBe(1);
expect(res[0].objectId).toBe(uuid1);
expect(res[0].count).toBe(2);
expect(res[0].x).toBe(1);
});

it('handles updating a single object with array, object date', done => {
Expand Down

0 comments on commit 468fc2a

Please sign in to comment.