Merge branch 'develop' into doc-roundValue

This commit is contained in:
Michael Teeuw 2017-08-10 12:14:16 +02:00 committed by GitHub
commit 1d662e354b
6 changed files with 66 additions and 3 deletions

View File

@ -13,11 +13,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add unit test the capitalizeFirstLetter function of newfeed module.
- Add new unit tests for function `shorten` in calendar module.
- Add unit tests for function `roundValue` in currentweather module.
- Add test e2e showWeek feature in spanish language.
### Updated
- Changed 'default.js' - listen on all attached interfaces by default.
- Add execution of `npm list` after the test are ran in Travis CI.
- Change hooks for the vendors e2e tests.
- Add log when clientonly failed on starting.
- Add warning color when are using full ip whitelist.
### Fixed
- Fixed issue with incorrect allignment of analog clock when displayed in the center column of the MM.

View File

@ -87,6 +87,13 @@
child.on("error", function (err) {
process.stdout.write(`Client: ${err}`);
});
child.on('close', (code) => {
if (code != 0) {
console.log(`There something wrong. The clientonly is not running code ${code}`);
}
});
})
.catch(function (reason) {
fail(`Unable to connect to server: (${reason})`);
@ -94,4 +101,4 @@
} else {
fail();
}
}());
}());

View File

@ -13,6 +13,7 @@ var path = require("path");
var ipfilter = require("express-ipfilter").IpFilter;
var fs = require("fs");
var helmet = require("helmet");
var Utils = require(__dirname + "/utils.js");
var Server = function(config, callback) {
@ -26,7 +27,7 @@ var Server = function(config, callback) {
server.listen(port, config.address ? config.address : null);
if (config.ipWhitelist instanceof Array && config.ipWhitelist.length == 0) {
console.info("You're using a full whitelist configuration to allow for all IPs")
console.info(Utils.colors.warn("You're using a full whitelist configuration to allow for all IPs"))
}
app.use(function(req, res, next) {

View File

@ -44,7 +44,7 @@
"http-auth": "^3.1.3",
"jshint": "^2.9.4",
"mocha": "^3.4.2",
"spectron": "^3.6.4",
"spectron": "3.6.x",
"stylelint": "^7.11.0",
"stylelint-config-standard": "latest",
"time-grunt": "latest"

View File

@ -0,0 +1,38 @@
/* Magic Mirror
*
* Test config for default clock module
* Language es for showWeek feature
*
* By Rodrigo Ramírez Norambuena
* https://rodrigoramirez.com
*
* MIT Licensed.
*/
var config = {
port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
language: "es",
timeFormat: 12,
units: "metric",
electronOptions: {
webPreferences: {
nodeIntegration: true,
},
},
modules: [
{
module: "clock",
position: "middle_center",
config: {
showWeek: true
}
}
]
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

View File

@ -73,4 +73,18 @@ describe("Clock set to spanish language module", function() {
return app.client.waitUntilWindowLoaded().getText(".clock .time").should.eventually.match(timeRegex);
});
});
describe("with showWeek config enabled", function() {
before(function() {
// Set config sample for use in test
process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/es/clock_showWeek.js";
});
it("shows week with correct format", function() {
const weekRegex = /^Semana [0-9]{1,2}$/;
return app.client.waitUntilWindowLoaded()
.getText(".clock .week").should.eventually.match(weekRegex);
});
});
});