removed an fdescribe, added servicesDir to some spec files and refactors

This commit is contained in:
Carlos Jimenez 2018-08-13 13:11:37 +02:00
parent 51f7958612
commit bd2befe3ef
10 changed files with 21 additions and 29 deletions

View File

@ -1,4 +1,4 @@
const app = require('../../../../../client/server/server');
const app = require(`${servicesDir}/client/server/server`);
describe('Client activeSalesPerson', () => {
it('should call the activeSalesPerson() method with limit of 1', async() => {

View File

@ -1,5 +1,5 @@
const app = require('../../../../../client/server/server');
const restoreFixtures = require('../../../../../../services/db/testing_fixtures');
const app = require(`${servicesDir}/client/server/server`);
const restoreFixtures = require(`${servicesDir}/db/testing_fixtures`);
describe('Client addressesPropagateRe', () => {
let sqlStatements = {deletes: ``, inserts: ``, updates:

View File

@ -1,4 +1,4 @@
const app = require('../../../../../client/server/server');
const app = require(`${servicesDir}/client/server/server`);
describe('Client card', () => {
it('should call the card() method to receive a formated card of Bruce Wayne', async() => {

View File

@ -1,5 +1,5 @@
const app = require('../../../../../client/server/server');
const restoreFixtures = require('../../../../../../services/db/testing_fixtures');
const app = require(`${servicesDir}/client/server/server`);
const restoreFixtures = require(`${servicesDir}/db/testing_fixtures`);
describe('Client Create', () => {
let sqlStatements = {deletes: `

View File

@ -1,16 +1,10 @@
const getDebt = require('../getDebt');
const app = require(`${servicesDir}/client/server/server`);
describe('client getDebt()', () => {
it('should call the getDebt method', done => {
let clientFk = 109;
let self = jasmine.createSpyObj('self', ['remoteMethod', 'rawSql']);
self.rawSql.and.returnValue(Promise.resolve([{debt: 100}]));
getDebt(self);
self.getDebt(clientFk)
.then(result => {
expect(result.debt).toEqual(100);
done();
});
it('should return the client debt', async() => {
let result = await app.models.Client.getDebt(101);
expect(result.debt).toEqual(1389.9);
});
});

View File

@ -1,12 +1,10 @@
const app = require(`${servicesDir}/client/server/server`);
describe('client getMana()', () => {
it('should call the getMana method', done => {
app.models.Client.getMana(101)
.then(response => {
expect(response.mana).toEqual(260);
done();
});
it('should call the getMana method', async() => {
let result = await app.models.Client.getMana(101);
expect(result.mana).toEqual(260);
});
});

View File

@ -1,5 +1,5 @@
const app = require('../../../../../client/server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
const app = require(`${servicesDir}/client/server/server`);
const catchErrors = require(`${servicesDir}/utils/jasmineHelpers`).catchErrors;
describe('Client hasCustomerRole', () => {
it('should call the hasCustomerRole() method with a customer id', done => {

View File

@ -1,4 +1,4 @@
const app = require('../../../../../client/server/server');
const app = require(`${servicesDir}/client/server/server`);
describe('Client isValidClient', () => {
it('should call the isValidClient() method with a client id and receive true', done => {

View File

@ -1,5 +1,5 @@
const app = require('../../../../../client/server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
const app = require(`${servicesDir}/client/server/server`);
const catchErrors = require(`${servicesDir}/utils/jasmineHelpers`).catchErrors;
describe('Client listWorkers', () => {
it('should call the listWorkers()', done => {

View File

@ -1,6 +1,6 @@
// const app = require(`${servicesDir}/ticket/server/server`);
// fdescribe('ticket summary()', () => {
// describe('ticket summary()', () => {
// describe('getTicketData()', () => {
// it('should sum all sales price', done => {
// let result = getTicketData(model, 1);