#561 getTotalVolume.js back unit test + servicesDir added to spec files
This commit is contained in:
parent
a6d7eff637
commit
be132e33cb
|
@ -1,4 +1,4 @@
|
|||
const app = require(`../../../../server/server`);
|
||||
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() => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const app = require(`../../../../server/server`);
|
||||
const app = require(`${servicesDir}/order/server/server`);
|
||||
|
||||
describe('order getTotal()', () => {
|
||||
it('should return the total', async() => {
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
const app = require(`${servicesDir}/order/server/server`);
|
||||
|
||||
describe('order getTotalVolume()', () => {
|
||||
it('should return the total', async() => {
|
||||
let result = await app.models.Order.getTotalVolume(1);
|
||||
|
||||
expect(result.totalVolume).toEqual(0.072);
|
||||
expect(result.totalBoxes).toBeFalsy();
|
||||
});
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
const app = require(`../../../../server/server`);
|
||||
const app = require(`${servicesDir}/order/server/server`);
|
||||
|
||||
describe('order getVolumes()', () => {
|
||||
it('should return the volumes of a given order id', async() => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const app = require(`../../../../server/server`);
|
||||
const app = require(`${servicesDir}/order/server/server`);
|
||||
const UserError = require('vn-loopback/common/helpers').UserError;
|
||||
|
||||
describe('order isEditable()', () => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const app = require(`../../../../server/server`);
|
||||
const app = require(`${servicesDir}/order/server/server`);
|
||||
|
||||
describe('order itemFilter()', () => {
|
||||
it('should call the itemFilter method and return an array of items', async() => {
|
||||
|
|
Loading…
Reference in New Issue