Merge pull request #969 from roramirez/showWeek-test-es-language

Show week test es language
This commit is contained in:
Michael Teeuw 2017-08-10 12:11:25 +02:00 committed by GitHub
commit 673e051bd5
3 changed files with 53 additions and 0 deletions

View File

@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add `.vscode/` folder to `.gitignore` to keep custom Visual Studio Code config out of git. - Add `.vscode/` folder to `.gitignore` to keep custom Visual Studio Code config out of git.
- Add unit test the capitalizeFirstLetter function of newfeed module. - Add unit test the capitalizeFirstLetter function of newfeed module.
- Add new unit tests for function `shorten` in calendar module. - Add new unit tests for function `shorten` in calendar module.
- Add test e2e showWeek feature in spanish language.
### Updated ### Updated
- Changed 'default.js' - listen on all attached interfaces by default. - Changed 'default.js' - listen on all attached interfaces by default.

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