23 lines
821 B
JavaScript
23 lines
821 B
JavaScript
const app = require(`${servicesDir}/order/server/server`);
|
|
|
|
describe('order getTaxes()', () => {
|
|
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);
|
|
});
|
|
|
|
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);
|
|
});
|
|
|
|
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);
|
|
|
|
expect(result[0].tax).toEqual(9.49);
|
|
expect(result.length).toEqual(1);
|
|
});
|
|
});
|