Reinitialize config

This commit is contained in:
Bartek Fabiszewski 2019-12-17 20:30:56 +01:00
parent 0745bfc92e
commit 28ead5ba86
5 changed files with 5 additions and 6 deletions

View File

@ -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: {} };

View File

@ -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);

View File

@ -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', () => {

View File

@ -80,7 +80,7 @@ describe('TrackViewModel tests', () => {
</div>`;
document.body.insertAdjacentHTML('afterbegin', fixture);
config.initialize();
config.reinitialize();
config.interval = 10;
lang.init(config);
trackEl = document.querySelector('#track');

View File

@ -43,7 +43,7 @@ describe('UserViewModel tests', () => {
</div>`;
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';