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

27 lines
719 B
JavaScript

const models = require('vn-loopback/server/server').models;
// f
fdescribe('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();
});
});