Changes to have settings tests pass. test/specs/settings_test.js

This commit is contained in:
David Meza
2017-09-28 23:26:12 -05:00
parent 0efe676a8e
commit 76ced43a68
6 changed files with 22 additions and 6 deletions

View File

@@ -4,7 +4,7 @@
"showTrayIcon": false,
"trayIconTheme": "light",
"minimizeToTray": false,
"version": "1",
"version": 1,
"notifications": {
"flashWindow": 0
},
@@ -17,7 +17,7 @@
"showTrayIcon": false,
"trayIconTheme": "light",
"minimizeToTray": false,
"version": "1",
"version": 1,
"notifications": {
"flashWindow": 0
},

View File

@@ -1,7 +1,10 @@
'use strict';
const fs = require('fs');
const deepmerge = require('deepmerge').default;
let deepmerge = require('deepmerge').default;
if (process.env.TEST) {
deepmerge = require('deepmerge'); // eslint-disable-line
}
const settingsVersion = 1;
const baseConfig = require('./config/base.json');
@@ -32,7 +35,7 @@ function loadDefault(version, spellCheckerLocale) {
}
function upgradeV0toV1(configV0) {
var config = loadDefault('1');
var config = loadDefault(1);
config.teams.push({
name: 'Primary team',
url: configV0.url
@@ -41,7 +44,7 @@ function upgradeV0toV1(configV0) {
}
function upgrade(config, newAppVersion) {
var configVersion = config.version ? config.version : '1';
var configVersion = config.version ? config.version : 0;
if (newAppVersion) {
config.lastMattermostVersion = newAppVersion;
}