Adds fix for issue affecting update with CLP (#5269)

* Adds fix for issue affecting update with CLP

* Disable single instance
This commit is contained in:
Florent Vilmart
2019-01-04 14:23:27 -05:00
committed by GitHub
parent 9f2fc88f0f
commit 46ac7e7f11
6 changed files with 22 additions and 23 deletions

View File

@@ -2043,6 +2043,23 @@ describe('schemas', () => {
.catch(done.fail);
});
it('regression test for #5177', async () => {
Parse.Object.disableSingleInstance();
Parse.Cloud.beforeSave('AClass', () => {});
await setPermissionsOnClass(
'AClass',
{
update: { '*': true },
},
false
);
const obj = new Parse.Object('AClass');
await obj.save({ key: 1 }, { useMasterKey: true });
obj.increment('key', 10);
const objectAgain = await obj.save();
expect(objectAgain.get('key')).toBe(11);
});
it('regression test for #2246', done => {
const profile = new Parse.Object('UserProfile');
const user = new Parse.User();