From d5d8145feedc76d925ce9d5f9be0642d3e74bd59 Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Wed, 15 Nov 2017 13:05:11 +0100 Subject: [PATCH] bugs fixed --- client/client/src/billing-data/billing-data.js | 1 - client/client/src/search-panel/search-panel.spec.js | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/client/client/src/billing-data/billing-data.js b/client/client/src/billing-data/billing-data.js index 46849c070..a6887039e 100644 --- a/client/client/src/billing-data/billing-data.js +++ b/client/client/src/billing-data/billing-data.js @@ -46,7 +46,6 @@ export default class Controller { this.$http.post(`/mailer/manuscript/payment-update/${this.client.id}`).then( () => { this.vnApp.showMessage(this.translate.instant('Notification sent!')); - this.checkEtChanges(); } ); } diff --git a/client/client/src/search-panel/search-panel.spec.js b/client/client/src/search-panel/search-panel.spec.js index 2c3137ff0..e4b7b5634 100644 --- a/client/client/src/search-panel/search-panel.spec.js +++ b/client/client/src/search-panel/search-panel.spec.js @@ -3,17 +3,17 @@ import './search-panel.js'; describe('Client', () => { describe('Component vnClientSearchPanel', () => { let $componentController; - let $window; + let sessionStorage; let controller; beforeEach(() => { angular.mock.module('client'); }); - beforeEach(angular.mock.inject((_$componentController_, _$window_) => { + beforeEach(angular.mock.inject((_$componentController_, _sessionStorage_) => { $componentController = _$componentController_; - $window = _$window_; - controller = $componentController('vnClientSearchPanel', {$window: $window}); + sessionStorage = _sessionStorage_; + controller = $componentController('vnClientSearchPanel', {sessionStorage: sessionStorage}); })); describe('onSearch()', () => { @@ -31,10 +31,10 @@ describe('Client', () => { describe('$onChanges()', () => { it('should set filter properties using the search values', () => { expect(controller.filter).not.toBeDefined(); - spyOn(JSON, 'parse').and.returnValue({data: 'data'}); + spyOn(sessionStorage, 'get').and.returnValue({data: 'data'}); controller.$onChanges(); - expect(controller.filter).toBe(JSON.parse({data: 'data'})); + expect(controller.filter).toBe(sessionStorage.get({data: 'data'})); }); }); });