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

23 lines
821 B
JavaScript
Raw Normal View History

const app = require(`${servicesDir}/order/server/server`);
2018-08-07 14:04:42 +00:00
describe('order getTaxes()', () => {
2018-08-07 14:04:42 +00:00
it('should call the getTaxes method and return undefined if its called with a string', async() => {
let result = await app.models.Order.getTaxes('pepinillos');
expect(result.length).toEqual(0);
2018-08-07 14:04:42 +00:00
});
it('should call the getTaxes method and return undefined if its called with unknown id', async() => {
let result = await app.models.Order.getTaxes(99999999999999999999999);
expect(result.length).toEqual(0);
2018-08-07 14:04:42 +00:00
});
it('should call the getTaxes method and return the taxes if its called with a known id', async() => {
let result = await app.models.Order.getTaxes(1);
2018-10-10 10:55:04 +00:00
expect(result[0].tax).toEqual(9.49);
expect(result.length).toEqual(1);
2018-08-07 14:04:42 +00:00
});
});