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

18 lines
556 B
JavaScript
Raw Normal View History

2018-10-10 12:13:53 +00:00
const app = require(`${servicesDir}/order/server/server`);
describe('order getVAT()', () => {
it('should call the getVAT method and return the response', async() => {
await app.models.Order.getVAT(1)
.then(response => {
expect(response).toEqual(9.49);
});
});
it(`should call the getVAT method and return zero if doesn't have lines`, async() => {
await app.models.Order.getVAT(13)
.then(response => {
expect(response).toEqual(0);
});
});
});