#561 getTotalVolume.js back unit test + servicesDir added to spec files

This commit is contained in:
Carlos Jimenez 2018-08-14 11:52:10 +02:00
parent a6d7eff637
commit be132e33cb
6 changed files with 15 additions and 5 deletions

View File

@ -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() => {

View File

@ -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() => {

View File

@ -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();
});
});

View File

@ -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() => {

View File

@ -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()', () => {

View File

@ -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() => {