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

16 lines
448 B
JavaScript
Raw Normal View History

const app = require(`${servicesDir}/ticket/server/server`);
2018-04-17 12:49:55 +00:00
describe('ticket getTotal()', () => {
it('should return the total of a ticket', async() => {
let result = await app.models.Ticket.getTotal(1);
expect(result).toEqual(448.25);
2018-04-17 12:49:55 +00:00
});
it(`should return zero if the ticket doesn't have lines`, async() => {
let result = await app.models.Ticket.getTotal(13);
expect(result).toEqual(0);
2018-04-17 12:49:55 +00:00
});
});