2018-04-19 09:20:41 +00:00
|
|
|
const app = require(`${servicesDir}/ticket/server/server`);
|
2018-04-17 12:49:55 +00:00
|
|
|
|
|
|
|
describe('ticket getTotal()', () => {
|
2018-08-14 12:32:27 +00:00
|
|
|
it('should return the total of a ticket', async() => {
|
|
|
|
let result = await app.models.Ticket.getTotal(1);
|
|
|
|
|
2018-09-11 13:09:15 +00:00
|
|
|
expect(result).toEqual(181.12);
|
2018-04-17 12:49:55 +00:00
|
|
|
});
|
|
|
|
|
2018-08-14 12:32:27 +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
|
|
|
});
|
|
|
|
});
|