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

18 lines
561 B
JavaScript
Raw Normal View History

2018-06-19 10:10:38 +00:00
const app = require(`${servicesDir}/ticket/server/server`);
describe('ticket getVAT()', () => {
it('should call the getVAT method and return the response', async() => {
await app.models.Ticket.getVAT(1)
2018-06-19 10:10:38 +00:00
.then(response => {
2018-09-11 13:09:15 +00:00
expect(response).toEqual(22.98);
2018-06-19 10:10:38 +00:00
});
});
it(`should call the getVAT method and return zero if doesn't have lines`, async() => {
await app.models.Ticket.getVAT(13)
2018-06-19 10:10:38 +00:00
.then(response => {
expect(response).toEqual(0);
});
});
});