Backend tests fixed
This commit is contained in:
parent
87dec5e8b2
commit
30ab925ed7
|
@ -9,7 +9,7 @@ let verbose = false;
|
||||||
if (process.argv[2] === '--v')
|
if (process.argv[2] === '--v')
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
||||||
servicesDir = `${__dirname}/services/db`;
|
serviceRoot = `${__dirname}/services/db`;
|
||||||
|
|
||||||
let Jasmine = require('jasmine');
|
let Jasmine = require('jasmine');
|
||||||
let jasmine = new Jasmine();
|
let jasmine = new Jasmine();
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
const app = require(`${servicesDir}/claim/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Claim importTicketSales()', () => {
|
describe('Claim importTicketSales()', () => {
|
||||||
let claimEnds;
|
let claimEnds;
|
||||||
|
|
||||||
afterAll(async() => {
|
afterAll(async () => {
|
||||||
claimEnds.forEach(async line => {
|
claimEnds.forEach(async line => {
|
||||||
await line.destroy();
|
await line.destroy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should import sales to a claim actions from an specific ticket', async() => {
|
it('should import sales to a claim actions from an specific ticket', async () => {
|
||||||
let ctx = {req: {accessToken: {userId: 5}}};
|
let ctx = {req: {accessToken: {userId: 5}}};
|
||||||
claimEnds = await app.models.ClaimEnd.importTicketSales(ctx, {
|
claimEnds = await app.models.ClaimEnd.importTicketSales(ctx, {
|
||||||
claimFk: 1,
|
claimFk: 1,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Client createWithInsurance', () => {
|
describe('Client createWithInsurance', () => {
|
||||||
let classificationId;
|
let classificationId;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('receipt filter()', () => {
|
describe('receipt filter()', () => {
|
||||||
it('should call the filter method', async () => {
|
it('should call the filter method', async () => {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
const app = require(`../../../ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
const server = require(`../../../loopback/server/server`);
|
const ParameterizedSQL = require('vn-loopback/node_modules/loopback-connector').ParameterizedSQL;
|
||||||
const ParameterizedSQL = server.loopbackConnector.ParameterizedSQL;
|
|
||||||
|
|
||||||
describe('last_buy_refresh()', () => {
|
describe('last_buy_refresh()', () => {
|
||||||
it(`should store some data on cache.last_buy`, async () => {
|
it(`should store some data on cache.last_buy`, async () => {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
const app = require(`../../../ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
const server = require(`../../../loopback/server/server`);
|
const ParameterizedSQL = require('vn-loopback/node_modules/loopback-connector').ParameterizedSQL;
|
||||||
const ParameterizedSQL = server.loopbackConnector.ParameterizedSQL;
|
|
||||||
|
|
||||||
describe('buyUltimate()', () => {
|
describe('buyUltimate()', () => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
const app = require(`../../../ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
const server = require(`../../../loopback/server/server`);
|
const ParameterizedSQL = require('vn-loopback/node_modules/loopback-connector').ParameterizedSQL;
|
||||||
const ParameterizedSQL = server.loopbackConnector.ParameterizedSQL;
|
|
||||||
|
|
||||||
describe('buyUltimateFromInterval()', () => {
|
describe('buyUltimateFromInterval()', () => {
|
||||||
let today;
|
let today;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
const app = require(`../../../ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
const server = require(`../../../loopback/server/server`);
|
const ParameterizedSQL = require('vn-loopback/node_modules/loopback-connector').ParameterizedSQL;
|
||||||
const ParameterizedSQL = server.loopbackConnector.ParameterizedSQL;
|
|
||||||
|
|
||||||
describe('logAddWithUser()', () => {
|
describe('logAddWithUser()', () => {
|
||||||
it('should log any action taken by the user in a table ending in Log', async () => {
|
it('should log any action taken by the user in a table ending in Log', async () => {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
const app = require(`../../../ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
const server = require(`../../../loopback/server/server`);
|
const ParameterizedSQL = require('vn-loopback/node_modules/loopback-connector').ParameterizedSQL;
|
||||||
const ParameterizedSQL = server.loopbackConnector.ParameterizedSQL;
|
|
||||||
|
|
||||||
describe('ticket ticketCalculateClon()', () => {
|
describe('ticket ticketCalculateClon()', () => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
const app = require(`../../../ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
const server = require(`../../../loopback/server/server`);
|
const ParameterizedSQL = require('vn-loopback/node_modules/loopback-connector').ParameterizedSQL;
|
||||||
const ParameterizedSQL = server.loopbackConnector.ParameterizedSQL;
|
|
||||||
|
|
||||||
describe('ticketComponentUpdateSale()', () => {
|
describe('ticketComponentUpdateSale()', () => {
|
||||||
it(`should update the sale price when option ONE using the base components and reclaculate only the ones with isRenewable TRUE`, async () => {
|
it(`should update the sale price when option ONE using the base components and reclaculate only the ones with isRenewable TRUE`, async () => {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
const app = require(`../../../ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
const server = require(`../../../loopback/server/server`);
|
const ParameterizedSQL = require('vn-loopback/node_modules/loopback-connector').ParameterizedSQL;
|
||||||
const ParameterizedSQL = server.loopbackConnector.ParameterizedSQL;
|
|
||||||
|
|
||||||
describe('ticket ticketCreateWithUser()', () => {
|
describe('ticket ticketCreateWithUser()', () => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/claim/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
// xcluded waiting for fixtures
|
// xcluded waiting for fixtures
|
||||||
xdescribe('claimBeginning', () => {
|
xdescribe('claimBeginning', () => {
|
||||||
let ticket;
|
let ticket;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/claim/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Claim Create', () => {
|
describe('Claim Create', () => {
|
||||||
let newDate = new Date();
|
let newDate = new Date();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/claim/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('claim getSummary()', () => {
|
describe('claim getSummary()', () => {
|
||||||
it('should return summary with claim, salesClaimed, developments and actions defined ', async() => {
|
it('should return summary with claim, salesClaimed, developments and actions defined ', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/claim/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
// xcluded waiting for fixtures
|
// xcluded waiting for fixtures
|
||||||
xdescribe('regularizeClaim()', () => {
|
xdescribe('regularizeClaim()', () => {
|
||||||
const claimFk = 1;
|
const claimFk = 1;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/claim/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Update Claim', () => {
|
describe('Update Claim', () => {
|
||||||
let newDate = new Date();
|
let newDate = new Date();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Client activeWorkersWithRole', () => {
|
describe('Client activeWorkersWithRole', () => {
|
||||||
it('should return the sales people as result', async () => {
|
it('should return the sales people as result', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Client addressesPropagateRe', () => {
|
describe('Client addressesPropagateRe', () => {
|
||||||
let client;
|
let client;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Client confirmTransaction', () => {
|
describe('Client confirmTransaction', () => {
|
||||||
const transactionId = 2;
|
const transactionId = 2;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Client Create', () => {
|
describe('Client Create', () => {
|
||||||
const clientName = 'Wade';
|
const clientName = 'Wade';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('client getAverageInvoiced()', () => {
|
describe('client getAverageInvoiced()', () => {
|
||||||
it('should call the getAverageInvoiced method', done => {
|
it('should call the getAverageInvoiced method', done => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Client card', () => {
|
describe('Client card', () => {
|
||||||
it('should call the card() method to receive a formated card of Bruce Wayne', async () => {
|
it('should call the card() method to receive a formated card of Bruce Wayne', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
xdescribe('client getDebt()', () => {
|
xdescribe('client getDebt()', () => {
|
||||||
it('should return the client debt', async () => {
|
it('should return the client debt', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('client getMana()', () => {
|
describe('client getMana()', () => {
|
||||||
it('should call the getMana method', async() => {
|
it('should call the getMana method', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Client getTransations', () => {
|
describe('Client getTransations', () => {
|
||||||
it('should call getTransations() method to receive a list of Web Payments from Bruce Wayne', async() => {
|
it('should call getTransations() method to receive a list of Web Payments from Bruce Wayne', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Client hasCustomerRole', () => {
|
describe('Client hasCustomerRole', () => {
|
||||||
it('should call the hasCustomerRole() method with a customer id', done => {
|
it('should call the hasCustomerRole() method with a customer id', done => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Client isValidClient', () => {
|
describe('Client isValidClient', () => {
|
||||||
it('should call the isValidClient() method with a client id and receive true', done => {
|
it('should call the isValidClient() method with a client id and receive true', done => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Client listWorkers', () => {
|
describe('Client listWorkers', () => {
|
||||||
it('should call the listWorkers()', done => {
|
it('should call the listWorkers()', done => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('client summary()', () => {
|
describe('client summary()', () => {
|
||||||
it('should return a summary object containing data', async () => {
|
it('should return a summary object containing data', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Client updateFiscalData', () => {
|
describe('Client updateFiscalData', () => {
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/item/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('item filterItemTags()', () => {
|
describe('item filterItemTags()', () => {
|
||||||
it('should filter ItemTags table', async () => {
|
it('should filter ItemTags table', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/item/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('item clone()', () => {
|
describe('item clone()', () => {
|
||||||
let nextItemId;
|
let nextItemId;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/item/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('item filter()', () => {
|
describe('item filter()', () => {
|
||||||
it('should return 1 result using filter and tags', async() => {
|
it('should return 1 result using filter and tags', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/item/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('item getShipped()', () => {
|
describe('item getShipped()', () => {
|
||||||
it('should return 3 entries, the first one with the property balance -100', async() => {
|
it('should return 3 entries, the first one with the property balance -100', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/item/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('item getLastEntries()', () => {
|
describe('item getLastEntries()', () => {
|
||||||
it('should return one entry for a given item', async () => {
|
it('should return one entry for a given item', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/item/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('item getSummary()', () => {
|
describe('item getSummary()', () => {
|
||||||
it('should return summary with item, tags, botanical, niches, available and visible defined ', async() => {
|
it('should return summary with item, tags, botanical, niches, available and visible defined ', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/item/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('regularize()', () => {
|
describe('regularize()', () => {
|
||||||
const itemFk = 1;
|
const itemFk = 1;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/item/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('item updateTaxes()', () => {
|
describe('item updateTaxes()', () => {
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('message send()', () => {
|
describe('message send()', () => {
|
||||||
it('should call the send method and return the response', async() => {
|
it('should call the send method and return the response', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/order/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
describe('order catalogFilter()', () => {
|
describe('order catalogFilter()', () => {
|
||||||
it('should return an array of items', async () => {
|
it('should return an array of items', async () => {
|
||||||
let filter = {
|
let filter = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/order/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('order getTaxes()', () => {
|
describe('order getTaxes()', () => {
|
||||||
it('should call the getTaxes method and return undefined if its called with a string', async() => {
|
it('should call the getTaxes method and return undefined if its called with a string', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/order/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('order getTotal()', () => {
|
describe('order getTotal()', () => {
|
||||||
it('should return the total', async() => {
|
it('should return the total', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/order/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('order getTotalVolume()', () => {
|
describe('order getTotalVolume()', () => {
|
||||||
it('should return the total', async() => {
|
it('should return the total', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/order/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('order getVAT()', () => {
|
describe('order getVAT()', () => {
|
||||||
it('should call the getVAT method and return the response', async() => {
|
it('should call the getVAT method and return the response', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/order/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('order getVolumes()', () => {
|
describe('order getVolumes()', () => {
|
||||||
it('should return the volumes of a given order id', async() => {
|
it('should return the volumes of a given order id', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/order/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('order isEditable()', () => {
|
describe('order isEditable()', () => {
|
||||||
it('should return false when the given order is not editable', async() => {
|
it('should return false when the given order is not editable', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/order/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
let UserError = require('../../../helpers').UserError;
|
let UserError = require('../../../helpers').UserError;
|
||||||
|
|
||||||
describe('order new()', () => {
|
describe('order new()', () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/order/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('order summary()', () => {
|
describe('order summary()', () => {
|
||||||
it('should return a summary object containing data from 1 order', async() => {
|
it('should return a summary object containing data from 1 order', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/order/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Order updateBasicData', () => {
|
describe('Order updateBasicData', () => {
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('sale getClaimableFromTicket()', () => {
|
describe('sale getClaimableFromTicket()', () => {
|
||||||
it('should return the claimable sales of a given ticket', async () => {
|
it('should return the claimable sales of a given ticket', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('sale moveToTicket()', () => {
|
describe('sale moveToTicket()', () => {
|
||||||
it('should throw an error if the ticket is not editable', async () => {
|
it('should throw an error if the ticket is not editable', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('sale priceDifference()', () => {
|
describe('sale priceDifference()', () => {
|
||||||
it('should return ticket price differences', async() => {
|
it('should return ticket price differences', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('sale removes()', () => {
|
describe('sale removes()', () => {
|
||||||
let sale;
|
let sale;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('sale reserve()', () => {
|
describe('sale reserve()', () => {
|
||||||
afterAll(async() => {
|
afterAll(async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('sale updatePrice()', () => {
|
describe('sale updatePrice()', () => {
|
||||||
it('should throw an error if the price is not a number', async() => {
|
it('should throw an error if the price is not a number', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('sale updateQuantity()', () => {
|
describe('sale updateQuantity()', () => {
|
||||||
it('should throw an error if the quantity is not a number', async() => {
|
it('should throw an error if the quantity is not a number', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket changeState()', () => {
|
describe('ticket changeState()', () => {
|
||||||
let ticket;
|
let ticket;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket componentUpdate()', () => {
|
describe('ticket componentUpdate()', () => {
|
||||||
let firstvalueBeforeChange;
|
let firstvalueBeforeChange;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket deleted()', () => {
|
describe('ticket deleted()', () => {
|
||||||
let ticket;
|
let ticket;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket filter()', () => {
|
describe('ticket filter()', () => {
|
||||||
it('should call the filter method', async () => {
|
it('should call the filter method', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket getLanded()', () => {
|
describe('ticket getLanded()', () => {
|
||||||
it('should return a landing date', async() => {
|
it('should return a landing date', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket getSales()', () => {
|
describe('ticket getSales()', () => {
|
||||||
it('should return the sales of a ticket', async () => {
|
it('should return the sales of a ticket', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket getSalesPersonMana()', () => {
|
describe('ticket getSalesPersonMana()', () => {
|
||||||
it('should get the mana of a salesperson of a given ticket', async() => {
|
it('should get the mana of a salesperson of a given ticket', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket getShipped()', () => {
|
describe('ticket getShipped()', () => {
|
||||||
it('should return a shipment date', async() => {
|
it('should return a shipment date', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket getTaxes()', () => {
|
describe('ticket getTaxes()', () => {
|
||||||
it('should return the tax of a given ticket', async() => {
|
it('should return the tax of a given ticket', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket getTotal()', () => {
|
describe('ticket getTotal()', () => {
|
||||||
it('should return the total of a ticket', async() => {
|
it('should return the total of a ticket', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket getTotalVolume()', () => {
|
describe('ticket getTotalVolume()', () => {
|
||||||
it('should return the total volume of a ticket', async() => {
|
it('should return the total volume of a ticket', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket getVAT()', () => {
|
describe('ticket getVAT()', () => {
|
||||||
it('should call the getVAT method and return the response', async() => {
|
it('should call the getVAT method and return the response', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket getVolume()', () => {
|
describe('ticket getVolume()', () => {
|
||||||
it('should call the getVolume method', async() => {
|
it('should call the getVolume method', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket isEditable()', () => {
|
describe('ticket isEditable()', () => {
|
||||||
it('should return false if the ticket given is not editable', async () => {
|
it('should return false if the ticket given is not editable', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket new()', () => {
|
describe('ticket new()', () => {
|
||||||
let ticket;
|
let ticket;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket summary()', () => {
|
describe('ticket summary()', () => {
|
||||||
it('should return a summary object containing data from 1 ticket', async() => {
|
it('should return a summary object containing data from 1 ticket', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket threeLastActive()', () => {
|
describe('ticket threeLastActive()', () => {
|
||||||
it('should return the last three active tickets', async() => {
|
it('should return the last three active tickets', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('userConfig getUserConfig()', () => {
|
describe('userConfig getUserConfig()', () => {
|
||||||
it(`should return the configuration data of a given user`, async() => {
|
it(`should return the configuration data of a given user`, async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require('../../../../../item/server/server');
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Model crud()', () => {
|
describe('Model crud()', () => {
|
||||||
let insertId;
|
let insertId;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require('../../../../../order/server/server');
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Model getSetValues()', () => {
|
describe('Model getSetValues()', () => {
|
||||||
it('should extend getSetValues properties to any model passed', () => {
|
it('should extend getSetValues properties to any model passed', () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require('../../../../../item/server/server');
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('Model rewriteDbError()', () => {
|
describe('Model rewriteDbError()', () => {
|
||||||
it('should extend rewriteDbError properties to any model passed', () => {
|
it('should extend rewriteDbError properties to any model passed', () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('workerMana getCurrentWorkerMana()', () => {
|
describe('workerMana getCurrentWorkerMana()', () => {
|
||||||
it('should get the mana of the logged worker', async() => {
|
it('should get the mana of the logged worker', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('loopback model Account', () => {
|
describe('loopback model Account', () => {
|
||||||
it('should return true if the user has the given role', async() => {
|
it('should return true if the user has the given role', async() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('loopback model address', () => {
|
describe('loopback model address', () => {
|
||||||
let createdAddressId;
|
let createdAddressId;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('loopback model Item', () => {
|
describe('loopback model Item', () => {
|
||||||
describe('availableId()', () => {
|
describe('availableId()', () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('loopback model State', () => {
|
describe('loopback model State', () => {
|
||||||
describe('isAlertLevelZero()', () => {
|
describe('isAlertLevelZero()', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const app = require('../../../server/server');
|
const app = require('../../../server/server');
|
||||||
const routes = require('../routes');
|
const routes = require('../auth');
|
||||||
|
|
||||||
describe('Auth routes', () => {
|
describe('Auth routes', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
|
@ -6,7 +6,6 @@ const DataSource = require('loopback-datasource-juggler').DataSource;
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const i18n = require('i18n');
|
const i18n = require('i18n');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const loopbackConnector = require('loopback-connector');
|
|
||||||
|
|
||||||
let _resolveConnector = DataSource._resolveConnector;
|
let _resolveConnector = DataSource._resolveConnector;
|
||||||
DataSource._resolveConnector = function(...args) {
|
DataSource._resolveConnector = function(...args) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`../../../../server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('order addToOrder()', () => {
|
describe('order addToOrder()', () => {
|
||||||
let rowToDelete;
|
let rowToDelete;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`../../../../server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('order removes()', () => {
|
describe('order removes()', () => {
|
||||||
let row;
|
let row;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket listPackaging()', () => {
|
describe('ticket listPackaging()', () => {
|
||||||
it('should call the listPackaging method and return the response', async () => {
|
it('should call the listPackaging method and return the response', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket listSaleTracking()', () => {
|
describe('ticket listSaleTracking()', () => {
|
||||||
it('should call the listSaleTracking method and return the response', async () => {
|
it('should call the listSaleTracking method and return the response', async () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${serviceRoot}/server/server`);
|
||||||
|
|
||||||
describe('ticket model TicketTracking', () => {
|
describe('ticket model TicketTracking', () => {
|
||||||
let ticketTrackingId;
|
let ticketTrackingId;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
const fs = require('fs-extra');
|
require('require-yaml');
|
||||||
|
|
||||||
process.on('warning', warning => {
|
process.on('warning', warning => {
|
||||||
console.log(warning.name);
|
console.log(warning.name);
|
||||||
console.log(warning.message);
|
console.log(warning.message);
|
||||||
|
@ -10,28 +11,20 @@ let verbose = false;
|
||||||
if (process.argv[2] === '--v')
|
if (process.argv[2] === '--v')
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
||||||
servicesDir = `${__dirname}/services`;
|
serviceRoot = `${__dirname}/services/loopback`;
|
||||||
|
|
||||||
let Jasmine = require('jasmine');
|
let Jasmine = require('jasmine');
|
||||||
let jasmine = new Jasmine();
|
let jasmine = new Jasmine();
|
||||||
let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
||||||
|
|
||||||
let serviceList = fs.readdirSync(servicesDir);
|
|
||||||
let serviceSpecs = [
|
let serviceSpecs = [
|
||||||
'auth/server/**/*[sS]pec.js',
|
'loopback/server/**/*[sS]pec.js',
|
||||||
'salix/server/**/*[sS]pec.js'
|
'loopback/common/**/*[sS]pec.js'
|
||||||
];
|
];
|
||||||
const exclude = ['auth', 'salix'];
|
|
||||||
|
|
||||||
for (let service of serviceList) {
|
let services = require(`./services/services.yml`);
|
||||||
try {
|
for (let service of services)
|
||||||
let serviceDir = fs.readdirSync(`${servicesDir}/${service}`);
|
serviceSpecs.push(`${service}/**/*[sS]pec.js`);
|
||||||
for (let file of serviceDir) {
|
|
||||||
if (file === 'server' && exclude.indexOf(service) == -1)
|
|
||||||
serviceSpecs.push(`${service}/common/**/*[sS]pec.js`);
|
|
||||||
}
|
|
||||||
} catch (e) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
jasmine.loadConfig({
|
jasmine.loadConfig({
|
||||||
spec_dir: 'services',
|
spec_dir: 'services',
|
||||||
|
|
Loading…
Reference in New Issue