/*
* μlogger
*
* Copyright(C) 2019 Bartek Fabiszewski (www.fabiszewski.net)
*
* This is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see .
*/
import { config, lang } from '../src/initializer.js';
import ConfigViewModel from '../src/configviewmodel.js';
import ViewModel from '../src/viewmodel.js';
import uObserve from '../src/observe.js';
import uState from '../src/state.js';
import uUtils from '../src/utils.js';
describe('ConfigViewModel tests', () => {
let vm;
let state;
/** @type {HTMLSpanElement} */
let intervalEl;
/** @type {HTMLAnchorElement} */
let setIntervalEl;
/** @type {HTMLSelectElement} */
let apiEl;
/** @type {HTMLSelectElement} */
let langEl;
/** @type {HTMLSelectElement} */
let unitsEl;
const newInterval = 99;
const newMapApi = 'openlayers';
const newLang = 'pl';
const newUnits = 'imperial';
beforeEach(() => {
config.reinitialize();
config.interval = 10;
config.lang = 'en';
config.units = 'metric';
config.mapApi = 'gmaps';
const fixture = `