diff --git a/services/loopback/common/methods/client/specs/addressesPropagateRe.spec.js b/services/client/common/methods/client/specs/addressesPropagateRe.spec.js similarity index 100% rename from services/loopback/common/methods/client/specs/addressesPropagateRe.spec.js rename to services/client/common/methods/client/specs/addressesPropagateRe.spec.js diff --git a/services/loopback/common/methods/client/specs/card.spec.js b/services/client/common/methods/client/specs/card.spec.js similarity index 100% rename from services/loopback/common/methods/client/specs/card.spec.js rename to services/client/common/methods/client/specs/card.spec.js diff --git a/services/loopback/common/methods/client/specs/createWithUser.spec.js b/services/client/common/methods/client/specs/createWithUser.spec.js similarity index 100% rename from services/loopback/common/methods/client/specs/createWithUser.spec.js rename to services/client/common/methods/client/specs/createWithUser.spec.js diff --git a/services/loopback/common/methods/client/specs/hasCustomerRole.spec.js b/services/client/common/methods/client/specs/hasCustomerRole.spec.js similarity index 100% rename from services/loopback/common/methods/client/specs/hasCustomerRole.spec.js rename to services/client/common/methods/client/specs/hasCustomerRole.spec.js diff --git a/services/loopback/common/methods/client/specs/listAddresses.spec.js b/services/client/common/methods/client/specs/listAddresses.spec.js similarity index 100% rename from services/loopback/common/methods/client/specs/listAddresses.spec.js rename to services/client/common/methods/client/specs/listAddresses.spec.js diff --git a/services/loopback/common/methods/client/specs/listWorkers.spec.js b/services/client/common/methods/client/specs/listWorkers.spec.js similarity index 70% rename from services/loopback/common/methods/client/specs/listWorkers.spec.js rename to services/client/common/methods/client/specs/listWorkers.spec.js index 532d44aac..33222c4d8 100644 --- a/services/loopback/common/methods/client/specs/listWorkers.spec.js +++ b/services/client/common/methods/client/specs/listWorkers.spec.js @@ -3,13 +3,13 @@ const catchErrors = require('../../../../../../services/utils/jasmineHelpers').c describe('Client listWorkers', () => { it('should call the listWorkers()', done => { - let callback = (error, result) => { - if (error) return catchErrors(done)(error); + app.models.Client.listWorkers() + .then(result => { let amountOfEmployees = Object.keys(result).length; expect(amountOfEmployees).toEqual(6); done(); - }; - app.models.Client.listWorkers(callback); + }) + .catch(catchErrors(done)); }); }); diff --git a/services/loopback/common/methods/client/specs/salesperson.spec.js b/services/client/common/methods/client/specs/salesperson.spec.js similarity index 100% rename from services/loopback/common/methods/client/specs/salesperson.spec.js rename to services/client/common/methods/client/specs/salesperson.spec.js diff --git a/services/client/common/methods/greuge/specs/total.spec.js b/services/client/common/methods/greuge/specs/sumAmount.spec.js similarity index 93% rename from services/client/common/methods/greuge/specs/total.spec.js rename to services/client/common/methods/greuge/specs/sumAmount.spec.js index 1646d9c38..41339702a 100644 --- a/services/client/common/methods/greuge/specs/total.spec.js +++ b/services/client/common/methods/greuge/specs/sumAmount.spec.js @@ -1,4 +1,4 @@ -const totalGreuge = require('../total'); +const totalGreuge = require('../sumAmount'); const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors; describe('Greuge totalGreuge()', () => { diff --git a/services/loopback/server/server.js b/services/loopback/server/server.js index 6ebd49760..2a4f74695 100644 --- a/services/loopback/server/server.js +++ b/services/loopback/server/server.js @@ -26,7 +26,7 @@ function vnBoot(app, rootDir, rootModule) { // View - let viewDir = path.join(rootDir, '../client'); + let viewDir = `${rootDir}/../client`; if (fs.existsSync(viewDir)) { app.set('view engine', 'ejs');