From 28ead5ba867b789e1f6b6733c7c919e4385a278d Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Tue, 17 Dec 2019 20:30:56 +0100 Subject: [PATCH] Reinitialize config --- js/test/api_gmaps.test.js | 2 +- js/test/api_openlayers.test.js | 2 +- js/test/configviewmodel.test.js | 3 +-- js/test/trackviewmodel.test.js | 2 +- js/test/userviewmodel.test.js | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/js/test/api_gmaps.test.js b/js/test/api_gmaps.test.js index d68bdb4..e95bf33 100644 --- a/js/test/api_gmaps.test.js +++ b/js/test/api_gmaps.test.js @@ -33,7 +33,7 @@ describe('Google Maps map API tests', () => { gmStub.setupGmapsStub(); GoogleMapsApi.authError = false; GoogleMapsApi.gmInitialized = false; - config.initialize(); + config.reinitialize(); lang.init(config); container = document.createElement('div'); mockViewModel = { mapElement: container, model: {} }; diff --git a/js/test/api_openlayers.test.js b/js/test/api_openlayers.test.js index 3f56cea..3912bd8 100644 --- a/js/test/api_openlayers.test.js +++ b/js/test/api_openlayers.test.js @@ -31,7 +31,7 @@ describe('Openlayers map API tests', () => { let mockMap; beforeEach(() => { - config.initialize(); + config.reinitialize(); document.body.innerHTML = ''; container = document.createElement('div'); document.body.appendChild(container); diff --git a/js/test/configviewmodel.test.js b/js/test/configviewmodel.test.js index c66f5a5..22c9fed 100644 --- a/js/test/configviewmodel.test.js +++ b/js/test/configviewmodel.test.js @@ -44,7 +44,7 @@ describe('ConfigViewModel tests', () => { const newUnits = 'imperial'; beforeEach(() => { - config.initialize(); + config.reinitialize(); uObserve.setSilently(config, 'interval', 10); uObserve.setSilently(config, 'lang', 'en'); uObserve.setSilently(config, 'units', 'metric'); @@ -91,7 +91,6 @@ describe('ConfigViewModel tests', () => { afterEach(() => { document.body.removeChild(document.querySelector('#fixture')); - uObserve.unobserveAll(config); }); it('should create instance with state as parameter', () => { diff --git a/js/test/trackviewmodel.test.js b/js/test/trackviewmodel.test.js index 3672180..8293159 100644 --- a/js/test/trackviewmodel.test.js +++ b/js/test/trackviewmodel.test.js @@ -80,7 +80,7 @@ describe('TrackViewModel tests', () => { `; document.body.insertAdjacentHTML('afterbegin', fixture); - config.initialize(); + config.reinitialize(); config.interval = 10; lang.init(config); trackEl = document.querySelector('#track'); diff --git a/js/test/userviewmodel.test.js b/js/test/userviewmodel.test.js index f37db95..9cb6326 100644 --- a/js/test/userviewmodel.test.js +++ b/js/test/userviewmodel.test.js @@ -43,7 +43,7 @@ describe('UserViewModel tests', () => { `; document.body.insertAdjacentHTML('afterbegin', fixture); userEl = document.querySelector('#user'); - config.initialize(); + config.reinitialize(); lang.init(config); lang.strings['suser'] = 'select user'; lang.strings['allusers'] = 'all users';