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

26 lines
713 B
JavaScript

const models = require('vn-loopback/server/server').models;
describe('ClientDms removeFile()', () => {
it(`should return an error for a user without enough privileges`, async() => {
const tx = await models.Client.beginTransaction({});
let error;
try {
const options = {transaction: tx};
const clientDmsFk = 3;
const clientId = 1101;
const ctx = {req: {accessToken: {userId: clientId}}};
await models.ClientDms.removeFile(ctx, clientDmsFk, options);
await tx.rollback();
} catch (e) {
await tx.rollback();
error = e;
}
expect(error).toBeDefined();
});
});