(className, permissions, doPut)
| 155 | |
| 156 | it('properly passes the CLP to afterSave/afterDelete hook', function (done) { |
| 157 | async function setPermissionsOnClass(className, permissions, doPut) { |
| 158 | const method = doPut ? 'PUT' : 'POST'; |
| 159 | const response = await fetch(Parse.serverURL + '/schemas/' + className, { |
| 160 | method, |
| 161 | headers: { |
| 162 | 'X-Parse-Application-Id': Parse.applicationId, |
| 163 | 'X-Parse-Master-Key': Parse.masterKey, |
| 164 | 'Content-Type': 'application/json', |
| 165 | }, |
| 166 | body: JSON.stringify({ |
| 167 | classLevelPermissions: permissions, |
| 168 | }), |
| 169 | }); |
| 170 | const body = await response.json(); |
| 171 | if (body.error) { |
| 172 | throw body; |
| 173 | } |
| 174 | return body; |
| 175 | } |
| 176 | |
| 177 | let saveSpy; |
| 178 | let deleteSpy; |
no test coverage detected