Merge branch 'dev' of https://git.verdnatura.es/salix into dev

This commit is contained in:
Joan Sanchez 2018-08-14 11:36:48 +02:00
commit a6d7eff637
4 changed files with 4861 additions and 3720 deletions

View File

@ -0,0 +1,49 @@
import './index';
describe('Client', () => {
describe('Component vnClientDescriptorPopover', () => {
let $componentController;
let $httpBackend;
let $scope;
let controller;
let $element;
beforeEach(() => {
angular.mock.module('client');
});
beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$httpBackend_) => {
$componentController = _$componentController_;
$httpBackend = _$httpBackend_;
$httpBackend.when('GET', /\/locale\/\w+\/[a-z]{2}\.json/).respond({});
$element = angular.element(`<div></div>`);
$scope = $rootScope.$new();
controller = $componentController('vnClientDescriptorPopover', {$scope: $scope, $element: $element});
}));
describe('_getClientDebt()', () => {
it(`should perform a get query to store the client debt into the controller`, () => {
let clientFk = 1;
$httpBackend.when('GET', `/client/api/Clients/${clientFk}/getDebt`).respond({debt: 100});
$httpBackend.expect('GET', `/client/api/Clients/${clientFk}/getDebt`);
controller._getClientDebt(clientFk);
$httpBackend.flush();
expect(controller.clientDebt).toEqual(100);
});
});
describe('_getClient()', () => {
it(`should perform a get query to store the client data into the controller`, () => {
let clientFk = 1;
let response = {id: 1, name: 'name'};
$httpBackend.when('GET', `/client/api/Clients/${clientFk}/card`).respond(response);
$httpBackend.expect('GET', `/client/api/Clients/${clientFk}/card`);
controller._getClient(clientFk);
$httpBackend.flush();
expect(controller.client).toEqual(response);
});
});
});
});

8522
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -35,13 +35,13 @@
"cors": "^2.8.1",
"css-loader": "^0.25.0",
"del": "^2.2.2",
"electron": "^1.7.9",
"electron": "^1.8.7",
"eslint": "^3.19.0",
"eslint-config-angular": "^0.5.0",
"eslint-config-google": "^0.6.0",
"eslint-config-loopback": "^4.0.0",
"eslint-config-xo": "^0.17.0",
"eslint-plugin-jasmine": "^2.8.4",
"eslint-plugin-jasmine": "^2.10.1",
"fancy-log": "^1.3.2",
"file-loader": "^1.1.6",
"gulp": "^3.9.1",
@ -54,7 +54,7 @@
"gulp-wrap": "^0.13.0",
"gulp-yaml": "^1.0.1",
"html-loader": "^0.4.4",
"jasmine": "^2.9.0",
"jasmine": "^2.99.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^1.7.1",
"karma-chrome-launcher": "^2.2.0",
@ -68,7 +68,7 @@
"mysql2": "^1.5.2",
"nightmare": "^2.10.0",
"node-sass": "^4.7.2",
"nodemon": "^1.12.1",
"nodemon": "^1.18.3",
"plugin-error": "^1.0.1",
"raw-loader": "*",
"run-sequence": "^2.2.0",

View File

@ -1,7 +1,7 @@
const app = require(`../../../../server/server`);
describe('order getTotal()', () => {
it('should call the getTaxes method and return undefined if its called with a string', async() => {
it('should return the total', async() => {
let result = await app.models.Order.getTotal(1);
expect(result.total).toEqual(14.45);