fix: Unable to create new role if beforeSave hook exists (#8474)

This commit is contained in:
yog27ray
2023-03-23 01:52:32 +05:30
committed by GitHub
parent 0ec923937b
commit 4f0f0ec4bb
2 changed files with 21 additions and 8 deletions

View File

@@ -601,4 +601,12 @@ describe('Parse Role testing', () => {
});
});
});
it('should save role when beforeSave hook for _Role is present.', async done => {
Parse.Cloud.beforeSave('_Role', () => {});
const role = new Parse.Role('roleName', new Parse.ACL());
await role.save({}, { useMasterKey: true });
expect(role.id).toBeDefined();
done();
});
});