22 lines
769 B
JavaScript
22 lines
769 B
JavaScript
|
const app = require(`../../../../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).toEqual(undefined);
|
||
|
});
|
||
|
|
||
|
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).toEqual(undefined);
|
||
|
});
|
||
|
|
||
|
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.tax).toEqual(0.95);
|
||
|
});
|
||
|
});
|