salix/services/loopback/common/methods/ticket/specs/isEditable.spec.js

28 lines
850 B
JavaScript
Raw Normal View History

const app = require(`${servicesDir}/ticket/server/server`);
describe('ticket isEditable()', () => {
it('should return false if the ticket given is not editable', async() => {
let result = await app.models.Ticket.isEditable(2);
expect(result).toEqual(false);
});
it('should return false if the ticket given does not exists', async() => {
let result = await app.models.Ticket.isEditable(99999);
expect(result).toEqual(false);
});
it('should return false if the ticket given isDeleted', async() => {
let result = await app.models.Ticket.isEditable(21);
expect(result).toEqual(false);
});
it('should return true if the ticket given is editable', async() => {
2018-10-25 09:49:38 +00:00
let result = await app.models.Ticket.isEditable(16);
expect(result).toEqual(true);
});
});