2019-07-30 06:51:38 +00:00
|
|
|
const app = require('vn-loopback/server/server');
|
|
|
|
|
|
|
|
describe('TicketDms removeFile()', () => {
|
|
|
|
const ticketDmsId = 1;
|
|
|
|
it(`should return an error for a user without enough privileges`, async() => {
|
2021-06-23 11:24:23 +00:00
|
|
|
let clientId = 1101;
|
2019-07-30 06:51:38 +00:00
|
|
|
let ctx = {req: {accessToken: {userId: clientId}}};
|
|
|
|
|
|
|
|
let error;
|
|
|
|
await app.models.TicketDms.removeFile(ctx, ticketDmsId).catch(e => {
|
|
|
|
error = e;
|
|
|
|
}).finally(() => {
|
|
|
|
expect(error.message).toEqual(`You don't have enough privileges`);
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(error).toBeDefined();
|
|
|
|
});
|
|
|
|
});
|