2023-01-24 08:04:43 +00:00
|
|
|
const {models} = require('vn-loopback/server/server');
|
2019-06-06 11:59:11 +00:00
|
|
|
|
|
|
|
describe('dms uploadFile()', () => {
|
|
|
|
it(`should return an error for a user without enough privileges`, async() => {
|
2021-06-23 11:24:23 +00:00
|
|
|
let clientId = 1101;
|
2019-06-06 11:59:11 +00:00
|
|
|
let ticketDmsTypeId = 14;
|
|
|
|
let ctx = {req: {accessToken: {userId: clientId}}, args: {dmsTypeId: ticketDmsTypeId}};
|
|
|
|
|
|
|
|
let error;
|
2023-01-24 08:04:43 +00:00
|
|
|
await models.Dms.uploadFile(ctx).catch(e => {
|
2019-06-06 11:59:11 +00:00
|
|
|
error = e;
|
|
|
|
}).finally(() => {
|
|
|
|
expect(error.message).toEqual(`You don't have enough privileges`);
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(error).toBeDefined();
|
|
|
|
});
|
|
|
|
});
|