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-07-02 06:18:54 +00:00
expect(response).toEqual(58.75);
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);
});
});
});