salix/modules/worker/back/methods/worker-dms/specs/removeFile.spec.js

19 lines
580 B
JavaScript

const app = require('vn-loopback/server/server');
describe('WorkerDms removeFile()', () => {
const workerDmsFk = 1;
it(`should return an error for a user without enough privileges`, async() => {
let clientId = 101;
let ctx = {req: {accessToken: {userId: clientId}}};
let error;
await app.models.WorkerDms.removeFile(ctx, workerDmsFk).catch(e => {
error = e;
}).finally(() => {
expect(error.message).toEqual(`You don't have enough privileges`);
});
expect(error).toBeDefined();
});
});