From 947c2e556d81287e06521a53b0975e2ae61fa3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Sun, 9 Apr 2017 15:32:15 -0300 Subject: [PATCH 1/5] Add test e2e showWeek feature in spanish language. --- CHANGELOG.md | 1 + .../modules/clock/es/clock_showWeek.js | 38 +++++++++++++++++++ tests/e2e/modules/clock_es_spec.js | 23 +++++++++++ 3 files changed, 62 insertions(+) create mode 100644 tests/configs/modules/clock/es/clock_showWeek.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 22aa51ad..ba54034c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Add in option to wrap long calendar events to multiple lines using `wrapEvents` configuration option. - Add test e2e `show title newsfeed` for newsfeed module. - Add task to check configuration file. +- Add test e2e showWeek feature in spanish language. ### Updated - Added missing keys to Polish translation. diff --git a/tests/configs/modules/clock/es/clock_showWeek.js b/tests/configs/modules/clock/es/clock_showWeek.js new file mode 100644 index 00000000..29550f04 --- /dev/null +++ b/tests/configs/modules/clock/es/clock_showWeek.js @@ -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;} diff --git a/tests/e2e/modules/clock_es_spec.js b/tests/e2e/modules/clock_es_spec.js index f90263cf..09fadc7a 100644 --- a/tests/e2e/modules/clock_es_spec.js +++ b/tests/e2e/modules/clock_es_spec.js @@ -78,4 +78,27 @@ describe("Clock set to spanish language module", function () { .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"; + }); + + beforeEach(function (done) { + app.start().then(function() { done(); } ); + }); + + afterEach(function (done) { + app.stop().then(function() { done(); }); + }); + + 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); + }); + }); + }); From 84dc0b29595694003be8ed136b531de77b96bf28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Tue, 25 Jul 2017 10:28:17 -0400 Subject: [PATCH 2/5] Set version spectron for 3.6.x --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fe64cc41..9f9afeaf 100644 --- a/package.json +++ b/package.json @@ -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" From 765b03c86897806051c5b56a48ffe5f71a03c958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Tue, 25 Jul 2017 11:26:01 -0400 Subject: [PATCH 3/5] Add warning color when are using full ip whitelist --- js/server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/server.js b/js/server.js index 78aac2fe..fbc51cbc 100644 --- a/js/server.js +++ b/js/server.js @@ -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) { From 6abd120a5cccb09219be17694306ef0b7c30c196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Fri, 4 Aug 2017 22:39:52 -0400 Subject: [PATCH 4/5] Add CHANGELOG entry for color in warning if full ip whitelist --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f762dbe..b3cbb733 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - 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 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. From d34b493b7d84d7909e55a153cde0cde79eeb360c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Sat, 5 Aug 2017 22:30:38 -0400 Subject: [PATCH 5/5] Fix clock_es_spec running before the clock_spec --- tests/e2e/modules/clock_es_spec.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/e2e/modules/clock_es_spec.js b/tests/e2e/modules/clock_es_spec.js index f959e09b..455f3bed 100644 --- a/tests/e2e/modules/clock_es_spec.js +++ b/tests/e2e/modules/clock_es_spec.js @@ -74,21 +74,12 @@ describe("Clock set to spanish language module", function() { }); }); - 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"; }); - beforeEach(function (done) { - app.start().then(function() { done(); } ); - }); - - afterEach(function (done) { - app.stop().then(function() { done(); }); - }); - it("shows week with correct format", function() { const weekRegex = /^Semana [0-9]{1,2}$/; return app.client.waitUntilWindowLoaded()