mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Merge branch 'develop' into remove-old-weather-modules
# Conflicts: # modules/default/currentweather/currentweather.js
This commit is contained in:
commit
c392b5a661
4
.github/workflows/automated-tests.yml
vendored
4
.github/workflows/automated-tests.yml
vendored
@ -33,6 +33,4 @@ jobs:
|
|||||||
npm run test:prettier
|
npm run test:prettier
|
||||||
npm run test:js
|
npm run test:js
|
||||||
npm run test:css
|
npm run test:css
|
||||||
npm run test:unit
|
npm run test
|
||||||
npm run test:e2e
|
|
||||||
npm run test:electron
|
|
||||||
|
@ -13,11 +13,18 @@ _This release is scheduled to be released on 2022-04-01._
|
|||||||
|
|
||||||
- Added a config option under the weather module, absoluteDates, providing an option to format weather forecast date output with either absolute or relative dates.
|
- Added a config option under the weather module, absoluteDates, providing an option to format weather forecast date output with either absolute or relative dates.
|
||||||
- Added test for new weather forecast absoluteDates porperty.
|
- Added test for new weather forecast absoluteDates porperty.
|
||||||
|
- The modules get a class hidden added/removed if they get hidden/shown
|
||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
|
|
||||||
|
- deprecated roboto fonts package `roboto-fontface-bower` replaced with `fontsource`.
|
||||||
|
- update `helmet` to v5, use defaults of v4.
|
||||||
|
- updates Font Awesome css class to new default style (fixes #2768)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- improved and speedup e2e tests, artificial wait after mm start removed.
|
||||||
|
|
||||||
## [2.18.0] - 2022-01-01
|
## [2.18.0] - 2022-01-01
|
||||||
|
|
||||||
Special thanks to the following contributors: @AmpioRosso, @eouia, @fewieden, @jupadin, @khassel, @kolbyjack, @KristjanESPERANTO, @MariusVaice, @rejas, @rico24 and @sdetweil.
|
Special thanks to the following contributors: @AmpioRosso, @eouia, @fewieden, @jupadin, @khassel, @kolbyjack, @KristjanESPERANTO, @MariusVaice, @rejas, @rico24 and @sdetweil.
|
||||||
@ -42,6 +49,7 @@ Special thanks to the following contributors: @AmpioRosso, @eouia, @fewieden, @j
|
|||||||
- Added dangerouslyDisableAutoEscaping config option for newsfeed templates (fixes #2712).
|
- Added dangerouslyDisableAutoEscaping config option for newsfeed templates (fixes #2712).
|
||||||
- Added missing shebang to `installers/mm.sh`.
|
- Added missing shebang to `installers/mm.sh`.
|
||||||
- Node versions in templates and github workflows.
|
- Node versions in templates and github workflows.
|
||||||
|
- Updated translations for Traditional Chinese (Taiwan) (zh-tw.json).
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ Contributions of all kinds are welcome, not only in the form of code but also wi
|
|||||||
- documentation
|
- documentation
|
||||||
- translations
|
- translations
|
||||||
|
|
||||||
For the full contribution guidelines, check out: [https://docs.magicmirror.builders/getting-started/contributing.html](https://docs.magicmirror.builders/getting-started/contributing.html)
|
For the full contribution guidelines, check out: [https://docs.magicmirror.builders/about/contributing.html](https://docs.magicmirror.builders/about/contributing.html)
|
||||||
|
|
||||||
## Enjoying MagicMirror? Consider a donation!
|
## Enjoying MagicMirror? Consider a donation!
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* MIT Licensed.
|
* MIT Licensed.
|
||||||
*
|
*
|
||||||
* For more information on how you can configure this file
|
* For more information on how you can configure this file
|
||||||
* see https://docs.magicmirror.builders/getting-started/configuration.html#general
|
* see https://docs.magicmirror.builders/configuration/introduction.html
|
||||||
* and https://docs.magicmirror.builders/modules/configuration.html
|
* and https://docs.magicmirror.builders/modules/configuration.html
|
||||||
*/
|
*/
|
||||||
let config = {
|
let config = {
|
||||||
|
29
fonts/package-lock.json
generated
29
fonts/package-lock.json
generated
@ -7,20 +7,31 @@
|
|||||||
"name": "magicmirror-fonts",
|
"name": "magicmirror-fonts",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"roboto-fontface": "^0.10.0"
|
"@fontsource/roboto": "^4.5.1",
|
||||||
|
"@fontsource/roboto-condensed": "^4.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/roboto-fontface": {
|
"node_modules/@fontsource/roboto": {
|
||||||
"version": "0.10.0",
|
"version": "4.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/roboto-fontface/-/roboto-fontface-0.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-4.5.1.tgz",
|
||||||
"integrity": "sha512-OlwfYEgA2RdboZohpldlvJ1xngOins5d7ejqnIBWr9KaMxsnBqotpptRXTyfNRLnFpqzX6sTDt+X+a+6udnU8g=="
|
"integrity": "sha512-3mhfL+eNPG/woMNqwD/OHaW5qMpeGEBsDwzmhFmjB1yUV+M+M9P0NhP/AyHvnGz3DrqkvZ7CPzNMa+UkVLeELg=="
|
||||||
|
},
|
||||||
|
"node_modules/@fontsource/roboto-condensed": {
|
||||||
|
"version": "4.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fontsource/roboto-condensed/-/roboto-condensed-4.5.0.tgz",
|
||||||
|
"integrity": "sha512-P5On1DdWxWvBHC0kfinxGWOHveAS3wEHKpgfBidl6mzJI/nJyzcPxf5p5k0oT6uY0WzUCPPfsfgCmKMMULAXGg=="
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"roboto-fontface": {
|
"@fontsource/roboto": {
|
||||||
"version": "0.10.0",
|
"version": "4.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/roboto-fontface/-/roboto-fontface-0.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-4.5.1.tgz",
|
||||||
"integrity": "sha512-OlwfYEgA2RdboZohpldlvJ1xngOins5d7ejqnIBWr9KaMxsnBqotpptRXTyfNRLnFpqzX6sTDt+X+a+6udnU8g=="
|
"integrity": "sha512-3mhfL+eNPG/woMNqwD/OHaW5qMpeGEBsDwzmhFmjB1yUV+M+M9P0NhP/AyHvnGz3DrqkvZ7CPzNMa+UkVLeELg=="
|
||||||
|
},
|
||||||
|
"@fontsource/roboto-condensed": {
|
||||||
|
"version": "4.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fontsource/roboto-condensed/-/roboto-condensed-4.5.0.tgz",
|
||||||
|
"integrity": "sha512-P5On1DdWxWvBHC0kfinxGWOHveAS3wEHKpgfBidl6mzJI/nJyzcPxf5p5k0oT6uY0WzUCPPfsfgCmKMMULAXGg=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"url": "https://github.com/MichMich/MagicMirror/issues"
|
"url": "https://github.com/MichMich/MagicMirror/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"roboto-fontface": "^0.10.0"
|
"@fontsource/roboto": "^4.5.1",
|
||||||
|
"@fontsource/roboto-condensed": "^4.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,57 +2,57 @@
|
|||||||
font-family: Roboto;
|
font-family: Roboto;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 100;
|
font-weight: 100;
|
||||||
src: local("Roboto Thin"), local("Roboto-Thin"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Thin.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Thin.woff") format("woff");
|
src: local("Roboto Thin"), local("Roboto-Thin"), url("node_modules/@fontsource/roboto/files/roboto-latin-100-normal.woff2") format("woff2"), url("node_modules/@fontsource/roboto/files/roboto-latin-100-normal.woff") format("woff");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Roboto Condensed";
|
font-family: "Roboto Condensed";
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
src: local("Roboto Condensed Light"), local("RobotoCondensed-Light"), url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Light.woff2") format("woff2"),
|
src: local("Roboto Condensed Light"), local("RobotoCondensed-Light"), url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-300-normal.woff2") format("woff2"),
|
||||||
url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Light.woff") format("woff");
|
url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-300-normal.woff") format("woff");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Roboto Condensed";
|
font-family: "Roboto Condensed";
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local("Roboto Condensed"), local("RobotoCondensed-Regular"), url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Regular.woff2") format("woff2"),
|
src: local("Roboto Condensed"), local("RobotoCondensed-Regular"), url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-400-normal.woff2") format("woff2"),
|
||||||
url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Regular.woff") format("woff");
|
url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-400-normal.woff") format("woff");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Roboto Condensed";
|
font-family: "Roboto Condensed";
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: local("Roboto Condensed Bold"), local("RobotoCondensed-Bold"), url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Bold.woff2") format("woff2"),
|
src: local("Roboto Condensed Bold"), local("RobotoCondensed-Bold"), url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-700-normal.woff2") format("woff2"),
|
||||||
url("node_modules/roboto-fontface/fonts/roboto-condensed/Roboto-Condensed-Bold.woff") format("woff");
|
url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-700-normal.woff") format("woff");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: Roboto;
|
font-family: Roboto;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local("Roboto"), local("Roboto-Regular"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Regular.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Regular.woff") format("woff");
|
src: local("Roboto"), local("Roboto-Regular"), url("node_modules/@fontsource/roboto/files/roboto-latin-400-normal.woff2") format("woff2"), url("node_modules/@fontsource/roboto/files/roboto-latin-400-normal.woff") format("woff");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: Roboto;
|
font-family: Roboto;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
src: local("Roboto Medium"), local("Roboto-Medium"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Medium.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Medium.woff") format("woff");
|
src: local("Roboto Medium"), local("Roboto-Medium"), url("node_modules/@fontsource/roboto/files/roboto-latin-500-normal.woff2") format("woff2"), url("node_modules/@fontsource/roboto/files/roboto-latin-500-normal.woff") format("woff");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: Roboto;
|
font-family: Roboto;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: local("Roboto Bold"), local("Roboto-Bold"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Bold.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Bold.woff") format("woff");
|
src: local("Roboto Bold"), local("Roboto-Bold"), url("node_modules/@fontsource/roboto/files/roboto-latin-700-normal.woff2") format("woff2"), url("node_modules/@fontsource/roboto/files/roboto-latin-700-normal.woff") format("woff");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: Roboto;
|
font-family: Roboto;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
src: local("Roboto Light"), local("Roboto-Light"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Light.woff2") format("woff2"), url("node_modules/roboto-fontface/fonts/roboto/Roboto-Light.woff") format("woff");
|
src: local("Roboto Light"), local("Roboto-Light"), url("node_modules/@fontsource/roboto/files/roboto-latin-300-normal.woff2") format("woff2"), url("node_modules/@fontsource/roboto/files/roboto-latin-300-normal.woff") format("woff");
|
||||||
}
|
}
|
||||||
|
@ -245,6 +245,7 @@ const MM = (function () {
|
|||||||
if (moduleWrapper !== null) {
|
if (moduleWrapper !== null) {
|
||||||
moduleWrapper.style.transition = "opacity " + speed / 1000 + "s";
|
moduleWrapper.style.transition = "opacity " + speed / 1000 + "s";
|
||||||
moduleWrapper.style.opacity = 0;
|
moduleWrapper.style.opacity = 0;
|
||||||
|
moduleWrapper.classList.add("hidden");
|
||||||
|
|
||||||
clearTimeout(module.showHideTimer);
|
clearTimeout(module.showHideTimer);
|
||||||
module.showHideTimer = setTimeout(function () {
|
module.showHideTimer = setTimeout(function () {
|
||||||
@ -310,6 +311,7 @@ const MM = (function () {
|
|||||||
moduleWrapper.style.transition = "opacity " + speed / 1000 + "s";
|
moduleWrapper.style.transition = "opacity " + speed / 1000 + "s";
|
||||||
// Restore the position. See hideModule() for more info.
|
// Restore the position. See hideModule() for more info.
|
||||||
moduleWrapper.style.position = "static";
|
moduleWrapper.style.position = "static";
|
||||||
|
moduleWrapper.classList.remove("hidden");
|
||||||
|
|
||||||
updateWrapperStates();
|
updateWrapperStates();
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ function Server(config, callback) {
|
|||||||
res.status(403).send("This device is not allowed to access your mirror. <br> Please check your config.js or config.js.sample to change this.");
|
res.status(403).send("This device is not allowed to access your mirror. <br> Please check your config.js or config.js.sample to change this.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
app.use(helmet({ contentSecurityPolicy: false }));
|
app.use(helmet({ contentSecurityPolicy: false, crossOriginOpenerPolicy: false, crossOriginEmbedderPolicy: false, crossOriginResourcePolicy: false, originAgentCluster: false }));
|
||||||
|
|
||||||
app.use("/js", express.static(__dirname));
|
app.use("/js", express.static(__dirname));
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
*
|
*
|
||||||
* Copyright 2014, Codrops
|
* Copyright 2014, Codrops
|
||||||
* https://tympanus.net/codrops/
|
* https://tympanus.net/codrops/
|
||||||
|
*
|
||||||
|
* @param {object} window The window object
|
||||||
*/
|
*/
|
||||||
(function (window) {
|
(function (window) {
|
||||||
/**
|
/**
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
{% if imageUrl %}
|
{% if imageUrl %}
|
||||||
<img src="{{ imageUrl }}" height="{{ imageHeight }}" style="margin-bottom: 10px;"/>
|
<img src="{{ imageUrl }}" height="{{ imageHeight }}" style="margin-bottom: 10px;"/>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="bright fa fa-{{ imageFA }}" style='margin-bottom: 10px; font-size: {{ imageHeight }};'/></span>
|
<span class="bright fas fa-{{ imageFA }}" style='margin-bottom: 10px; font-size: {{ imageHeight }};'/></span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<br/>
|
<br/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -13,7 +13,7 @@ Module.register("calendar", {
|
|||||||
maximumNumberOfDays: 365,
|
maximumNumberOfDays: 365,
|
||||||
limitDays: 0, // Limit the number of days shown, 0 = no limit
|
limitDays: 0, // Limit the number of days shown, 0 = no limit
|
||||||
displaySymbol: true,
|
displaySymbol: true,
|
||||||
defaultSymbol: "calendar", // Fontawesome Symbol see https://fontawesome.com/cheatsheet?from=io
|
defaultSymbol: "calendar-alt", // Fontawesome Symbol see https://fontawesome.com/cheatsheet?from=io
|
||||||
showLocation: false,
|
showLocation: false,
|
||||||
displayRepeatingCountTitle: false,
|
displayRepeatingCountTitle: false,
|
||||||
defaultRepeatingCountTitle: "",
|
defaultRepeatingCountTitle: "",
|
||||||
@ -43,7 +43,7 @@ Module.register("calendar", {
|
|||||||
tableClass: "small",
|
tableClass: "small",
|
||||||
calendars: [
|
calendars: [
|
||||||
{
|
{
|
||||||
symbol: "calendar",
|
symbol: "calendar-alt",
|
||||||
url: "https://www.calendarlabs.com/templates/ical/US-Holidays.ics"
|
url: "https://www.calendarlabs.com/templates/ical/US-Holidays.ics"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -239,7 +239,7 @@ Module.register("calendar", {
|
|||||||
const symbols = this.symbolsForEvent(event);
|
const symbols = this.symbolsForEvent(event);
|
||||||
symbols.forEach((s, index) => {
|
symbols.forEach((s, index) => {
|
||||||
const symbol = document.createElement("span");
|
const symbol = document.createElement("span");
|
||||||
symbol.className = "fa fa-fw fa-" + s;
|
symbol.className = "fas fa-fw fa-" + s;
|
||||||
if (index > 0) {
|
if (index > 0) {
|
||||||
symbol.style.paddingLeft = "5px";
|
symbol.style.paddingLeft = "5px";
|
||||||
}
|
}
|
||||||
|
@ -199,13 +199,13 @@ Module.register("clock", {
|
|||||||
sunWrapper.innerHTML =
|
sunWrapper.innerHTML =
|
||||||
'<span class="' +
|
'<span class="' +
|
||||||
(isVisible ? "bright" : "") +
|
(isVisible ? "bright" : "") +
|
||||||
'"><i class="fa fa-sun-o" aria-hidden="true"></i> ' +
|
'"><i class="fas fa-sun" aria-hidden="true"></i> ' +
|
||||||
untilNextEventString +
|
untilNextEventString +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
'<span><i class="fa fa-arrow-up" aria-hidden="true"></i> ' +
|
'<span><i class="fas fa-arrow-up" aria-hidden="true"></i> ' +
|
||||||
formatTime(this.config, sunTimes.sunrise) +
|
formatTime(this.config, sunTimes.sunrise) +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
'<span><i class="fa fa-arrow-down" aria-hidden="true"></i> ' +
|
'<span><i class="fas fa-arrow-down" aria-hidden="true"></i> ' +
|
||||||
formatTime(this.config, sunTimes.sunset) +
|
formatTime(this.config, sunTimes.sunset) +
|
||||||
"</span>";
|
"</span>";
|
||||||
digitalWrapper.appendChild(sunWrapper);
|
digitalWrapper.appendChild(sunWrapper);
|
||||||
@ -230,13 +230,13 @@ Module.register("clock", {
|
|||||||
moonWrapper.innerHTML =
|
moonWrapper.innerHTML =
|
||||||
'<span class="' +
|
'<span class="' +
|
||||||
(isVisible ? "bright" : "") +
|
(isVisible ? "bright" : "") +
|
||||||
'"><i class="fa fa-moon-o" aria-hidden="true"></i> ' +
|
'"><i class="fas fa-moon" aria-hidden="true"></i> ' +
|
||||||
illuminatedFractionString +
|
illuminatedFractionString +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
'<span><i class="fa fa-arrow-up" aria-hidden="true"></i> ' +
|
'<span><i class="fas fa-arrow-up" aria-hidden="true"></i> ' +
|
||||||
(moonRise ? formatTime(this.config, moonRise) : "...") +
|
(moonRise ? formatTime(this.config, moonRise) : "...") +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
'<span><i class="fa fa-arrow-down" aria-hidden="true"></i> ' +
|
'<span><i class="fas fa-arrow-down" aria-hidden="true"></i> ' +
|
||||||
(moonSet ? formatTime(this.config, moonSet) : "...") +
|
(moonSet ? formatTime(this.config, moonSet) : "...") +
|
||||||
"</span>";
|
"</span>";
|
||||||
digitalWrapper.appendChild(moonWrapper);
|
digitalWrapper.appendChild(moonWrapper);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{% if not suspended %}
|
{% if not suspended %}
|
||||||
{% for name, status in moduleList %}
|
{% for name, status in moduleList %}
|
||||||
<div class="small bright">
|
<div class="small bright">
|
||||||
<i class="fa fa-exclamation-circle"></i>
|
<i class="fas fa-exclamation-circle"></i>
|
||||||
<span>
|
<span>
|
||||||
{% set mainTextLabel = "UPDATE_NOTIFICATION" if name === "default" else "UPDATE_NOTIFICATION_MODULE" %}
|
{% set mainTextLabel = "UPDATE_NOTIFICATION" if name === "default" else "UPDATE_NOTIFICATION_MODULE" %}
|
||||||
{{ mainTextLabel | translate({MODULE_NAME: name}) }}
|
{{ mainTextLabel | translate({MODULE_NAME: name}) }}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
{% if config.showWindDirection %}
|
{% if config.showWindDirection %}
|
||||||
<sup>
|
<sup>
|
||||||
{% if config.showWindDirectionAsArrow %}
|
{% if config.showWindDirectionAsArrow %}
|
||||||
<i class="fa fa-long-arrow-up" style="transform:rotate({{ current.windDirection }}deg);"></i>
|
<i class="fas fa-long-arrow-alt-up" style="transform:rotate({{ current.windDirection }}deg);"></i>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ current.cardinalWindDirection() | translate }}
|
{{ current.cardinalWindDirection() | translate }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<div class="normal light indoor">
|
<div class="normal light indoor">
|
||||||
{% if config.showIndoorTemperature and indoor.temperature %}
|
{% if config.showIndoorTemperature and indoor.temperature %}
|
||||||
<div>
|
<div>
|
||||||
<span class="fa fa-home"></span>
|
<span class="fas fa-home"></span>
|
||||||
<span class="bright">
|
<span class="bright">
|
||||||
{{ indoor.temperature | roundValue | unit("temperature") | decimalSymbol }}
|
{{ indoor.temperature | roundValue | unit("temperature") | decimalSymbol }}
|
||||||
</span>
|
</span>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if config.showIndoorHumidity and indoor.humidity %}
|
{% if config.showIndoorHumidity and indoor.humidity %}
|
||||||
<div>
|
<div>
|
||||||
<span class="fa fa-tint"></span>
|
<span class="fas fa-tint"></span>
|
||||||
<span class="bright">
|
<span class="bright">
|
||||||
{{ indoor.humidity | roundValue | unit("humidity") | decimalSymbol }}
|
{{ indoor.humidity | roundValue | unit("humidity") | decimalSymbol }}
|
||||||
</span>
|
</span>
|
||||||
|
2034
package-lock.json
generated
2034
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@ -47,12 +47,12 @@
|
|||||||
"homepage": "https://magicmirror.builders",
|
"homepage": "https://magicmirror.builders",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-jest": "^25.3.0",
|
"eslint-plugin-jest": "^25.3.4",
|
||||||
"eslint-plugin-jsdoc": "^37.4.0",
|
"eslint-plugin-jsdoc": "^37.6.1",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"express-basic-auth": "^1.2.1",
|
"express-basic-auth": "^1.2.1",
|
||||||
"husky": "^7.0.4",
|
"husky": "^7.0.4",
|
||||||
"jest": "^27.4.5",
|
"jest": "^27.4.7",
|
||||||
"jsdom": "^19.0.0",
|
"jsdom": "^19.0.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"nyc": "^15.1.0",
|
"nyc": "^15.1.0",
|
||||||
@ -67,23 +67,23 @@
|
|||||||
"suncalc": "^1.8.0"
|
"suncalc": "^1.8.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"electron": "^16.0.5"
|
"electron": "^16.0.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
"console-stamp": "^3.0.3",
|
"console-stamp": "^3.0.3",
|
||||||
"digest-fetch": "^1.2.1",
|
"digest-fetch": "^1.2.1",
|
||||||
"eslint": "^8.5.0",
|
"eslint": "^8.6.0",
|
||||||
"express": "^4.17.2",
|
"express": "^4.17.2",
|
||||||
"express-ipfilter": "^1.2.0",
|
"express-ipfilter": "^1.2.0",
|
||||||
"feedme": "^2.0.2",
|
"feedme": "^2.0.2",
|
||||||
"helmet": "^4.6.0",
|
"helmet": "^5.0.1",
|
||||||
"iconv-lite": "^0.6.3",
|
"iconv-lite": "^0.6.3",
|
||||||
"module-alias": "^2.2.2",
|
"module-alias": "^2.2.2",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"node-fetch": "^2.6.6",
|
"node-fetch": "^2.6.6",
|
||||||
"node-ical": "^0.13.0",
|
"node-ical": "^0.13.0",
|
||||||
"socket.io": "^4.4.0"
|
"socket.io": "^4.4.1"
|
||||||
},
|
},
|
||||||
"_moduleAliases": {
|
"_moduleAliases": {
|
||||||
"node_helper": "js/node_helper.js",
|
"node_helper": "js/node_helper.js",
|
||||||
@ -95,6 +95,7 @@
|
|||||||
"jest": {
|
"jest": {
|
||||||
"verbose": true,
|
"verbose": true,
|
||||||
"testTimeout": 15000,
|
"testTimeout": 15000,
|
||||||
|
"testSequencer": "<rootDir>/tests/configs/test_sequencer.js",
|
||||||
"projects": [
|
"projects": [
|
||||||
{
|
{
|
||||||
"displayName": "unit",
|
"displayName": "unit",
|
||||||
|
26
tests/configs/test_sequencer.js
Normal file
26
tests/configs/test_sequencer.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
const TestSequencer = require("@jest/test-sequencer").default;
|
||||||
|
|
||||||
|
class CustomSequencer extends TestSequencer {
|
||||||
|
sort(tests) {
|
||||||
|
const orderPath = ["unit", "e2e", "electron"];
|
||||||
|
return tests.sort((testA, testB) => {
|
||||||
|
let indexA = -1;
|
||||||
|
let indexB = -1;
|
||||||
|
const reg = ".*/tests/([^/]*).*";
|
||||||
|
|
||||||
|
let matchA = new RegExp(reg, "g").exec(testA.path);
|
||||||
|
if (matchA.length > 0) indexA = orderPath.indexOf(matchA[1]);
|
||||||
|
|
||||||
|
let matchB = new RegExp(reg, "g").exec(testB.path);
|
||||||
|
if (matchB.length > 0) indexB = orderPath.indexOf(matchB[1]);
|
||||||
|
|
||||||
|
if (indexA === indexB) return 0;
|
||||||
|
|
||||||
|
if (indexA === -1) return 1;
|
||||||
|
if (indexB === -1) return -1;
|
||||||
|
return indexA < indexB ? -1 : 1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = CustomSequencer;
|
@ -25,8 +25,9 @@ describe("App environment", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should show the title MagicMirror²", function () {
|
it("should show the title MagicMirror²", function () {
|
||||||
const elem = document.querySelector("title");
|
helpers.waitForElement("title").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toBe("MagicMirror²");
|
expect(elem.textContent).toBe("MagicMirror²");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -22,15 +22,34 @@ exports.stopApplication = function () {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.getDocument = function (callback, ms) {
|
exports.getDocument = function (callback) {
|
||||||
const url = "http://" + (config.address || "localhost") + ":" + (config.port || "8080");
|
const url = "http://" + (config.address || "localhost") + ":" + (config.port || "8080");
|
||||||
jsdom.JSDOM.fromURL(url, { resources: "usable", runScripts: "dangerously" }).then((dom) => {
|
jsdom.JSDOM.fromURL(url, { resources: "usable", runScripts: "dangerously" }).then((dom) => {
|
||||||
dom.window.name = "jsdom";
|
dom.window.name = "jsdom";
|
||||||
dom.window.onload = function () {
|
dom.window.onload = function () {
|
||||||
|
global.MutationObserver = dom.window.MutationObserver;
|
||||||
global.document = dom.window.document;
|
global.document = dom.window.document;
|
||||||
setTimeout(() => {
|
|
||||||
callback();
|
callback();
|
||||||
}, ms);
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.waitForElement = function (selector) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
if (document.querySelector(selector) && document.querySelector(selector).value !== undefined) {
|
||||||
|
return resolve(document.querySelector(selector));
|
||||||
|
}
|
||||||
|
|
||||||
|
const observer = new MutationObserver(() => {
|
||||||
|
if (document.querySelector(selector) && document.querySelector(selector).value !== undefined) {
|
||||||
|
resolve(document.querySelector(selector));
|
||||||
|
observer.disconnect();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(document.body, {
|
||||||
|
childList: true,
|
||||||
|
subtree: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
@ -3,15 +3,16 @@ const helpers = require("../global-setup");
|
|||||||
describe("Alert module", function () {
|
describe("Alert module", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/alert/default.js");
|
helpers.startApplication("tests/configs/modules/alert/default.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
afterAll(function () {
|
afterAll(function () {
|
||||||
helpers.stopApplication();
|
helpers.stopApplication();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the welcome message", function () {
|
it("should show the welcome message", function () {
|
||||||
const elem = document.querySelector(".ns-box .ns-box-inner .light.bright.small");
|
helpers.waitForElement(".ns-box .ns-box-inner .light.bright.small").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toContain("Welcome, start was successful!");
|
expect(elem.textContent).toContain("Welcome, start was successful!");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -8,15 +8,23 @@ describe("Calendar module", function () {
|
|||||||
* @param {string} not reverse result
|
* @param {string} not reverse result
|
||||||
*/
|
*/
|
||||||
function testElementLength(element, result, not) {
|
function testElementLength(element, result, not) {
|
||||||
const elem = document.querySelectorAll(element);
|
helpers.waitForElement(element).then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
if (not === "not") {
|
if (not === "not") {
|
||||||
expect(elem.length).not.toBe(result);
|
expect(elem.length).not.toBe(result);
|
||||||
} else {
|
} else {
|
||||||
expect(elem.length).toBe(result);
|
expect(elem.length).toBe(result);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const testTextContain = function (element, text) {
|
||||||
|
helpers.waitForElement(element).then((elem) => {
|
||||||
|
expect(elem).not.toBe(null);
|
||||||
|
expect(elem.textContent).toContain(text);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
afterAll(function () {
|
afterAll(function () {
|
||||||
helpers.stopApplication();
|
helpers.stopApplication();
|
||||||
});
|
});
|
||||||
@ -24,7 +32,7 @@ describe("Calendar module", function () {
|
|||||||
describe("Default configuration", function () {
|
describe("Default configuration", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/calendar/default.js");
|
helpers.startApplication("tests/configs/modules/calendar/default.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the default maximumEntries of 10", () => {
|
it("should show the default maximumEntries of 10", () => {
|
||||||
@ -32,14 +40,14 @@ describe("Calendar module", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should show the default calendar symbol in each event", () => {
|
it("should show the default calendar symbol in each event", () => {
|
||||||
testElementLength(".calendar .event .fa-calendar", 0, "not");
|
testElementLength(".calendar .event .fa-calendar-alt", 0, "not");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Custom configuration", function () {
|
describe("Custom configuration", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/calendar/custom.js");
|
helpers.startApplication("tests/configs/modules/calendar/custom.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the custom maximumEntries of 4", () => {
|
it("should show the custom maximumEntries of 4", () => {
|
||||||
@ -62,7 +70,7 @@ describe("Calendar module", function () {
|
|||||||
describe("Recurring event", function () {
|
describe("Recurring event", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/calendar/recurring.js");
|
helpers.startApplication("tests/configs/modules/calendar/recurring.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the recurring birthday event 6 times", () => {
|
it("should show the recurring birthday event 6 times", () => {
|
||||||
@ -78,13 +86,11 @@ describe("Calendar module", function () {
|
|||||||
return i * 60;
|
return i * 60;
|
||||||
};
|
};
|
||||||
helpers.startApplication("tests/configs/modules/calendar/recurring.js");
|
helpers.startApplication("tests/configs/modules/calendar/recurring.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain text "Mar 25th" in timezone UTC ' + -i, () => {
|
it('should contain text "Mar 25th" in timezone UTC ' + -i, () => {
|
||||||
const elem = document.querySelector(".calendar");
|
testTextContain(".calendar", "Mar 25th");
|
||||||
expect(elem).not.toBe(null);
|
|
||||||
expect(elem.textContent).toContain("Mar 25th");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -93,7 +99,7 @@ describe("Calendar module", function () {
|
|||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/calendar/changed-port.js");
|
helpers.startApplication("tests/configs/modules/calendar/changed-port.js");
|
||||||
serverBasicAuth.listen(8010);
|
serverBasicAuth.listen(8010);
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(function (done) {
|
afterAll(function (done) {
|
||||||
@ -108,7 +114,7 @@ describe("Calendar module", function () {
|
|||||||
describe("Basic auth", function () {
|
describe("Basic auth", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/calendar/basic-auth.js");
|
helpers.startApplication("tests/configs/modules/calendar/basic-auth.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should return TestEvents", function () {
|
it("should return TestEvents", function () {
|
||||||
@ -119,7 +125,7 @@ describe("Calendar module", function () {
|
|||||||
describe("Basic auth by default", function () {
|
describe("Basic auth by default", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/calendar/auth-default.js");
|
helpers.startApplication("tests/configs/modules/calendar/auth-default.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should return TestEvents", function () {
|
it("should return TestEvents", function () {
|
||||||
@ -130,7 +136,7 @@ describe("Calendar module", function () {
|
|||||||
describe("Basic auth backward compatibility configuration: DEPRECATED", function () {
|
describe("Basic auth backward compatibility configuration: DEPRECATED", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/calendar/old-basic-auth.js");
|
helpers.startApplication("tests/configs/modules/calendar/old-basic-auth.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should return TestEvents", function () {
|
it("should return TestEvents", function () {
|
||||||
@ -142,7 +148,7 @@ describe("Calendar module", function () {
|
|||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/calendar/fail-basic-auth.js");
|
helpers.startApplication("tests/configs/modules/calendar/fail-basic-auth.js");
|
||||||
serverBasicAuth.listen(8020);
|
serverBasicAuth.listen(8020);
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(function (done) {
|
afterAll(function (done) {
|
||||||
@ -150,9 +156,7 @@ describe("Calendar module", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should show Unauthorized error", function () {
|
it("should show Unauthorized error", function () {
|
||||||
const elem = document.querySelector(".calendar");
|
testTextContain(".calendar", "Error in the calendar module. Authorization failed");
|
||||||
expect(elem).not.toBe(null);
|
|
||||||
expect(elem.textContent).toContain("Error in the calendar module. Authorization failed");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -6,15 +6,16 @@ describe("Clock set to spanish language module", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const testMatch = function (element, regex) {
|
const testMatch = function (element, regex) {
|
||||||
const elem = document.querySelector(element);
|
helpers.waitForElement(element).then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toMatch(regex);
|
expect(elem.textContent).toMatch(regex);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
describe("with default 24hr clock config", function () {
|
describe("with default 24hr clock config", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/clock/es/clock_24hr.js");
|
helpers.startApplication("tests/configs/modules/clock/es/clock_24hr.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("shows date with correct format", function () {
|
it("shows date with correct format", function () {
|
||||||
@ -31,7 +32,7 @@ describe("Clock set to spanish language module", function () {
|
|||||||
describe("with default 12hr clock config", function () {
|
describe("with default 12hr clock config", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/clock/es/clock_12hr.js");
|
helpers.startApplication("tests/configs/modules/clock/es/clock_12hr.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("shows date with correct format", function () {
|
it("shows date with correct format", function () {
|
||||||
@ -48,7 +49,7 @@ describe("Clock set to spanish language module", function () {
|
|||||||
describe("with showPeriodUpper config enabled", function () {
|
describe("with showPeriodUpper config enabled", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/clock/es/clock_showPeriodUpper.js");
|
helpers.startApplication("tests/configs/modules/clock/es/clock_showPeriodUpper.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("shows 12hr time with upper case AM/PM", function () {
|
it("shows 12hr time with upper case AM/PM", function () {
|
||||||
@ -60,7 +61,7 @@ describe("Clock set to spanish language module", function () {
|
|||||||
describe("with showWeek config enabled", function () {
|
describe("with showWeek config enabled", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/clock/es/clock_showWeek.js");
|
helpers.startApplication("tests/configs/modules/clock/es/clock_showWeek.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("shows week with correct format", function () {
|
it("shows week with correct format", function () {
|
||||||
|
@ -7,15 +7,16 @@ describe("Clock module", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const testMatch = function (element, regex) {
|
const testMatch = function (element, regex) {
|
||||||
const elem = document.querySelector(element);
|
helpers.waitForElement(element).then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toMatch(regex);
|
expect(elem.textContent).toMatch(regex);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
describe("with default 24hr clock config", function () {
|
describe("with default 24hr clock config", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/clock/clock_24hr.js");
|
helpers.startApplication("tests/configs/modules/clock/clock_24hr.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the date in the correct format", function () {
|
it("should show the date in the correct format", function () {
|
||||||
@ -32,7 +33,7 @@ describe("Clock module", function () {
|
|||||||
describe("with default 12hr clock config", function () {
|
describe("with default 12hr clock config", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/clock/clock_12hr.js");
|
helpers.startApplication("tests/configs/modules/clock/clock_12hr.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the date in the correct format", function () {
|
it("should show the date in the correct format", function () {
|
||||||
@ -49,7 +50,7 @@ describe("Clock module", function () {
|
|||||||
describe("with showPeriodUpper config enabled", function () {
|
describe("with showPeriodUpper config enabled", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/clock/clock_showPeriodUpper.js");
|
helpers.startApplication("tests/configs/modules/clock/clock_showPeriodUpper.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show 12hr time with upper case AM/PM", function () {
|
it("should show 12hr time with upper case AM/PM", function () {
|
||||||
@ -61,7 +62,7 @@ describe("Clock module", function () {
|
|||||||
describe("with displaySeconds config disabled", function () {
|
describe("with displaySeconds config disabled", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/clock/clock_displaySeconds_false.js");
|
helpers.startApplication("tests/configs/modules/clock/clock_displaySeconds_false.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show 12hr time without seconds am/pm", function () {
|
it("should show 12hr time without seconds am/pm", function () {
|
||||||
@ -73,19 +74,20 @@ describe("Clock module", function () {
|
|||||||
describe("with showTime config disabled", function () {
|
describe("with showTime config disabled", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/clock/clock_showTime.js");
|
helpers.startApplication("tests/configs/modules/clock/clock_showTime.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show not show the time when digital clock is shown", function () {
|
it("should show not show the time when digital clock is shown", function () {
|
||||||
const elem = document.querySelector(".clock .digital .time");
|
helpers.waitForElement(".clock .digital .time").then((elem) => {
|
||||||
expect(elem).toBe(null);
|
expect(elem).toBe(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("with showWeek config enabled", function () {
|
describe("with showWeek config enabled", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/clock/clock_showWeek.js");
|
helpers.startApplication("tests/configs/modules/clock/clock_showWeek.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the week in the correct format", function () {
|
it("should show the week in the correct format", function () {
|
||||||
@ -96,21 +98,23 @@ describe("Clock module", function () {
|
|||||||
it("should show the week with the correct number of week of year", function () {
|
it("should show the week with the correct number of week of year", function () {
|
||||||
const currentWeekNumber = moment().week();
|
const currentWeekNumber = moment().week();
|
||||||
const weekToShow = "Week " + currentWeekNumber;
|
const weekToShow = "Week " + currentWeekNumber;
|
||||||
const elem = document.querySelector(".clock .week");
|
helpers.waitForElement(".clock .week").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toBe(weekToShow);
|
expect(elem.textContent).toBe(weekToShow);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("with analog clock face enabled", function () {
|
describe("with analog clock face enabled", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/clock/clock_analog.js");
|
helpers.startApplication("tests/configs/modules/clock/clock_analog.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the analog clock face", () => {
|
it("should show the analog clock face", () => {
|
||||||
const elem = document.querySelector(".clockCircle");
|
helpers.waitForElement(".clockCircle").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -6,11 +6,13 @@ const helpers = require("../global-setup");
|
|||||||
* @param {Array} complimentsArray The array of compliments.
|
* @param {Array} complimentsArray The array of compliments.
|
||||||
*/
|
*/
|
||||||
function doTest(complimentsArray) {
|
function doTest(complimentsArray) {
|
||||||
let elem = document.querySelector(".compliments");
|
helpers.waitForElement(".compliments").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
elem = document.querySelector(".module-content");
|
helpers.waitForElement(".module-content").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(complimentsArray).toContain(elem.textContent);
|
expect(complimentsArray).toContain(elem.textContent);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("Compliments module", function () {
|
describe("Compliments module", function () {
|
||||||
@ -21,7 +23,7 @@ describe("Compliments module", function () {
|
|||||||
describe("parts of days", function () {
|
describe("parts of days", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/compliments/compliments_parts_day.js");
|
helpers.startApplication("tests/configs/modules/compliments/compliments_parts_day.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("if Morning compliments for that part of day", function () {
|
it("if Morning compliments for that part of day", function () {
|
||||||
@ -53,7 +55,7 @@ describe("Compliments module", function () {
|
|||||||
describe("Set anytime and empty compliments for morning, evening and afternoon ", function () {
|
describe("Set anytime and empty compliments for morning, evening and afternoon ", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/compliments/compliments_anytime.js");
|
helpers.startApplication("tests/configs/modules/compliments/compliments_anytime.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Show anytime because if configure empty parts of day compliments and set anytime compliments", function () {
|
it("Show anytime because if configure empty parts of day compliments and set anytime compliments", function () {
|
||||||
@ -64,7 +66,7 @@ describe("Compliments module", function () {
|
|||||||
describe("Only anytime present in configuration compliments", function () {
|
describe("Only anytime present in configuration compliments", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/compliments/compliments_only_anytime.js");
|
helpers.startApplication("tests/configs/modules/compliments/compliments_only_anytime.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Show anytime compliments", function () {
|
it("Show anytime compliments", function () {
|
||||||
@ -77,7 +79,7 @@ describe("Compliments module", function () {
|
|||||||
describe("Set date and empty compliments for anytime, morning, evening and afternoon", function () {
|
describe("Set date and empty compliments for anytime, morning, evening and afternoon", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/compliments/compliments_date.js");
|
helpers.startApplication("tests/configs/modules/compliments/compliments_date.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Show happy new year compliment on new years day", function () {
|
it("Show happy new year compliment on new years day", function () {
|
||||||
|
@ -8,26 +8,28 @@ describe("Test helloworld module", function () {
|
|||||||
describe("helloworld set config text", function () {
|
describe("helloworld set config text", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/helloworld/helloworld.js");
|
helpers.startApplication("tests/configs/modules/helloworld/helloworld.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Test message helloworld module", function () {
|
it("Test message helloworld module", function () {
|
||||||
const elem = document.querySelector(".helloworld");
|
helpers.waitForElement(".helloworld").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toContain("Test HelloWorld Module");
|
expect(elem.textContent).toContain("Test HelloWorld Module");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("helloworld default config text", function () {
|
describe("helloworld default config text", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/helloworld/helloworld_default.js");
|
helpers.startApplication("tests/configs/modules/helloworld/helloworld_default.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Test message helloworld module", function () {
|
it("Test message helloworld module", function () {
|
||||||
const elem = document.querySelector(".helloworld");
|
helpers.waitForElement(".helloworld").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toContain("Hello World!");
|
expect(elem.textContent).toContain("Hello World!");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -8,69 +8,76 @@ describe("Newsfeed module", function () {
|
|||||||
describe("Default configuration", function () {
|
describe("Default configuration", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/newsfeed/default.js");
|
helpers.startApplication("tests/configs/modules/newsfeed/default.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the newsfeed title", function () {
|
it("should show the newsfeed title", function () {
|
||||||
const elem = document.querySelector(".newsfeed .newsfeed-source");
|
helpers.waitForElement(".newsfeed .newsfeed-source").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toContain("Rodrigo Ramirez Blog");
|
expect(elem.textContent).toContain("Rodrigo Ramirez Blog");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("should show the newsfeed article", function () {
|
it("should show the newsfeed article", function () {
|
||||||
const elem = document.querySelector(".newsfeed .newsfeed-title");
|
helpers.waitForElement(".newsfeed .newsfeed-title").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toContain("QPanel");
|
expect(elem.textContent).toContain("QPanel");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("should NOT show the newsfeed description", () => {
|
it("should NOT show the newsfeed description", () => {
|
||||||
const elem = document.querySelector(".newsfeed .newsfeed-desc");
|
helpers.waitForElement(".newsfeed .newsfeed-desc").then((elem) => {
|
||||||
expect(elem).toBe(null);
|
expect(elem).toBe(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("Custom configuration", function () {
|
describe("Custom configuration", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/newsfeed/prohibited_words.js");
|
helpers.startApplication("tests/configs/modules/newsfeed/prohibited_words.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not show articles with prohibited words", function () {
|
it("should not show articles with prohibited words", function () {
|
||||||
const elem = document.querySelector(".newsfeed .newsfeed-title");
|
helpers.waitForElement(".newsfeed .newsfeed-title").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toContain("Problema VirtualBox");
|
expect(elem.textContent).toContain("Problema VirtualBox");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("should show the newsfeed description", () => {
|
it("should show the newsfeed description", () => {
|
||||||
const elem = document.querySelector(".newsfeed .newsfeed-desc");
|
helpers.waitForElement(".newsfeed .newsfeed-desc").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent.length).not.toBe(0);
|
expect(elem.textContent.length).not.toBe(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("Invalid configuration", function () {
|
describe("Invalid configuration", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/newsfeed/incorrect_url.js");
|
helpers.startApplication("tests/configs/modules/newsfeed/incorrect_url.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show malformed url warning", function () {
|
it("should show malformed url warning", function () {
|
||||||
const elem = document.querySelector(".newsfeed .small");
|
helpers.waitForElement(".newsfeed .small").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toContain("Error in the Newsfeed module. Malformed url.");
|
expect(elem.textContent).toContain("Error in the Newsfeed module. Malformed url.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("Ignore items", function () {
|
describe("Ignore items", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/newsfeed/ignore_items.js");
|
helpers.startApplication("tests/configs/modules/newsfeed/ignore_items.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show empty items info message", function () {
|
it("should show empty items info message", function () {
|
||||||
const elem = document.querySelector(".newsfeed .small");
|
helpers.waitForElement(".newsfeed .small").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toContain("No news at the moment.");
|
expect(elem.textContent).toContain("No news at the moment.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -5,29 +5,20 @@ const fs = require("fs");
|
|||||||
const { generateWeather, generateWeatherForecast } = require("./mocks");
|
const { generateWeather, generateWeatherForecast } = require("./mocks");
|
||||||
|
|
||||||
describe("Weather module", function () {
|
describe("Weather module", function () {
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {string} element css selector
|
|
||||||
* @returns {Promise<Element>} Promise with the element once it is rendered
|
|
||||||
*/
|
|
||||||
function getElement(element) {
|
|
||||||
const elem = document.querySelector(element);
|
|
||||||
expect(elem).not.toBe(null);
|
|
||||||
return elem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} element css selector
|
* @param {string} element css selector
|
||||||
* @param {string} result Expected text in given selector
|
* @param {string} result Expected text in given selector
|
||||||
*/
|
*/
|
||||||
function getText(element, result) {
|
function getText(element, result) {
|
||||||
const elem = getElement(element);
|
helpers.waitForElement(element).then((elem) => {
|
||||||
|
expect(elem).not.toBe(null);
|
||||||
expect(
|
expect(
|
||||||
elem.textContent
|
elem.textContent
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/(\r\n|\n|\r)/gm, "")
|
.replace(/(\r\n|\n|\r)/gm, "")
|
||||||
.replace(/[ ]+/g, " ")
|
.replace(/[ ]+/g, " ")
|
||||||
).toBe(result);
|
).toBe(result);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +37,7 @@ describe("Weather module", function () {
|
|||||||
content = content.replace("#####WEATHERDATA#####", mockWeather);
|
content = content.replace("#####WEATHERDATA#####", mockWeather);
|
||||||
fs.writeFileSync(path.resolve(__dirname + "../../../../config/config.js"), content);
|
fs.writeFileSync(path.resolve(__dirname + "../../../../config/config.js"), content);
|
||||||
helpers.startApplication("");
|
helpers.startApplication("");
|
||||||
helpers.getDocument(callback, 3000);
|
helpers.getDocument(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
afterAll(function () {
|
afterAll(function () {
|
||||||
@ -117,9 +108,11 @@ describe("Weather module", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should render showWindDirectionAsArrow = true", function () {
|
it("should render showWindDirectionAsArrow = true", function () {
|
||||||
const elem = getElement(".weather .normal.medium sup i.fa-long-arrow-up");
|
helpers.waitForElement(".weather .normal.medium sup i.fa-long-arrow-alt-up").then((elem) => {
|
||||||
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.outerHTML).toContain("transform:rotate(250deg);");
|
expect(elem.outerHTML).toContain("transform:rotate(250deg);");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("should render showHumidity = true", function () {
|
it("should render showHumidity = true", function () {
|
||||||
getText(".weather .normal.medium span:nth-child(3)", "93.7");
|
getText(".weather .normal.medium span:nth-child(3)", "93.7");
|
||||||
@ -180,7 +173,9 @@ describe("Weather module", function () {
|
|||||||
const icons = ["day-cloudy", "rain", "day-sunny", "day-sunny", "day-sunny"];
|
const icons = ["day-cloudy", "rain", "day-sunny", "day-sunny", "day-sunny"];
|
||||||
|
|
||||||
for (const [index, icon] of icons.entries()) {
|
for (const [index, icon] of icons.entries()) {
|
||||||
getElement(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(2) span.wi-${icon}`);
|
helpers.waitForElement(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(2) span.wi-${icon}`).then((elem) => {
|
||||||
|
expect(elem).not.toBe(null);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -204,8 +199,10 @@ describe("Weather module", function () {
|
|||||||
const opacities = [1, 1, 0.8, 0.5333333333333333, 0.2666666666666667];
|
const opacities = [1, 1, 0.8, 0.5333333333333333, 0.2666666666666667];
|
||||||
|
|
||||||
for (const [index, opacity] of opacities.entries()) {
|
for (const [index, opacity] of opacities.entries()) {
|
||||||
const elem = getElement(`.weather table.small tr:nth-child(${index + 1})`);
|
helpers.waitForElement(`.weather table.small tr:nth-child(${index + 1})`).then((elem) => {
|
||||||
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.outerHTML).toContain(`<tr style="opacity: ${opacity};">`);
|
expect(elem.outerHTML).toContain(`<tr style="opacity: ${opacity};">`);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -230,15 +227,19 @@ describe("Weather module", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should render custom table class", function () {
|
it("should render custom table class", function () {
|
||||||
getElement(".weather table.myTableClass");
|
helpers.waitForElement(".weather table.myTableClass").then((elem) => {
|
||||||
|
expect(elem).not.toBe(null);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render colored rows", function () {
|
it("should render colored rows", function () {
|
||||||
const table = getElement(".weather table.myTableClass");
|
helpers.waitForElement(".weather table.myTableClass").then((table) => {
|
||||||
|
expect(table).not.toBe(null);
|
||||||
expect(table.rows).not.toBe(null);
|
expect(table.rows).not.toBe(null);
|
||||||
expect(table.rows.length).toBe(5);
|
expect(table.rows.length).toBe(5);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("Forecast weather units", function () {
|
describe("Forecast weather units", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
|
@ -3,22 +3,24 @@ const helpers = require("./global-setup");
|
|||||||
describe("Display of modules", function () {
|
describe("Display of modules", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/display.js");
|
helpers.startApplication("tests/configs/modules/display.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
afterAll(function () {
|
afterAll(function () {
|
||||||
helpers.stopApplication();
|
helpers.stopApplication();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the test header", function () {
|
it("should show the test header", function () {
|
||||||
const elem = document.querySelector("#module_0_helloworld .module-header");
|
helpers.waitForElement("#module_0_helloworld .module-header").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
// textContent gibt hier lowercase zurück, das uppercase wird durch css realisiert, was daher nicht in textContent landet
|
// textContent gibt hier lowercase zurück, das uppercase wird durch css realisiert, was daher nicht in textContent landet
|
||||||
expect(elem.textContent).toBe("test_header");
|
expect(elem.textContent).toBe("test_header");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("should show no header if no header text is specified", function () {
|
it("should show no header if no header text is specified", function () {
|
||||||
const elem = document.querySelector("#module_1_helloworld .module-header");
|
helpers.waitForElement("#module_1_helloworld .module-header").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toBe("undefined");
|
expect(elem.textContent).toBe("undefined");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,7 @@ const helpers = require("./global-setup");
|
|||||||
describe("Position of modules", function () {
|
describe("Position of modules", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/modules/positions.js");
|
helpers.startApplication("tests/configs/modules/positions.js");
|
||||||
helpers.getDocument(done, 3000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
afterAll(function () {
|
afterAll(function () {
|
||||||
helpers.stopApplication();
|
helpers.stopApplication();
|
||||||
@ -14,9 +14,10 @@ describe("Position of modules", function () {
|
|||||||
for (const position of positions) {
|
for (const position of positions) {
|
||||||
const className = position.replace("_", ".");
|
const className = position.replace("_", ".");
|
||||||
it("should show text in " + position, function () {
|
it("should show text in " + position, function () {
|
||||||
const elem = document.querySelector("." + className);
|
helpers.waitForElement("." + className).then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toContain("Text in " + position);
|
expect(elem.textContent).toContain("Text in " + position);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -3,21 +3,23 @@ const helpers = require("./global-setup");
|
|||||||
describe("Check configuration without modules", function () {
|
describe("Check configuration without modules", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
helpers.startApplication("tests/configs/without_modules.js");
|
helpers.startApplication("tests/configs/without_modules.js");
|
||||||
helpers.getDocument(done, 1000);
|
helpers.getDocument(done);
|
||||||
});
|
});
|
||||||
afterAll(function () {
|
afterAll(function () {
|
||||||
helpers.stopApplication();
|
helpers.stopApplication();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Show the message MagicMirror title", function () {
|
it("Show the message MagicMirror title", function () {
|
||||||
const elem = document.querySelector("#module_1_helloworld .module-content");
|
helpers.waitForElement("#module_1_helloworld .module-content").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toContain("Magic Mirror2");
|
expect(elem.textContent).toContain("Magic Mirror2");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("Show the text Michael's website", function () {
|
it("Show the text Michael's website", function () {
|
||||||
const elem = document.querySelector("#module_5_helloworld .module-content");
|
helpers.waitForElement("#module_5_helloworld .module-content").then((elem) => {
|
||||||
expect(elem).not.toBe(null);
|
expect(elem).not.toBe(null);
|
||||||
expect(elem.textContent).toContain("www.michaelteeuw.nl");
|
expect(elem.textContent).toContain("www.michaelteeuw.nl");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
{
|
{
|
||||||
"LOADING": "正在加載 …",
|
"LOADING": "正在載入 …",
|
||||||
|
|
||||||
"TODAY": "今天",
|
"TODAY": "今天",
|
||||||
"TOMORROW": "明天",
|
"TOMORROW": "明天",
|
||||||
|
"DAYAFTERTOMORROW": "後天",
|
||||||
"RUNNING": "結束日期",
|
"RUNNING": "結束日期",
|
||||||
"EMPTY": "沒有更多的活動。",
|
"EMPTY": "沒有更多的活動。",
|
||||||
|
"WEEK": "第 {weekNumber} 週",
|
||||||
|
|
||||||
"N": "北風",
|
"N": "北風",
|
||||||
"NNE": "北偏東風",
|
"NNE": "北偏東風",
|
||||||
@ -21,5 +23,22 @@
|
|||||||
"W": "西風",
|
"W": "西風",
|
||||||
"WNW": "西偏北風",
|
"WNW": "西偏北風",
|
||||||
"NW": "西北風",
|
"NW": "西北風",
|
||||||
"NNW": "北偏西風"
|
"NNW": "北偏西風",
|
||||||
|
|
||||||
|
"FEELS": "體感溫度 {DEGREE}",
|
||||||
|
"PRECIP": "降雨機率",
|
||||||
|
|
||||||
|
"MODULE_CONFIG_CHANGED": "模組 {MODULE_NAME} 的設定檔選項已更改。\n請參見說明文件。",
|
||||||
|
"MODULE_CONFIG_ERROR": "{MODULE_NAME} 模組發生錯誤。{ERROR}",
|
||||||
|
"MODULE_ERROR_MALFORMED_URL": "網址格式錯誤。",
|
||||||
|
"MODULE_ERROR_NO_CONNECTION": "無網路連線。",
|
||||||
|
"MODULE_ERROR_UNAUTHORIZED": "授權失敗。",
|
||||||
|
"MODULE_ERROR_UNSPECIFIED": "查看日誌以了解詳情。",
|
||||||
|
|
||||||
|
"NEWSFEED_NO_ITEMS": "目前沒有新聞。",
|
||||||
|
|
||||||
|
"UPDATE_NOTIFICATION": "MagicMirror² 有可用更新。",
|
||||||
|
"UPDATE_NOTIFICATION_MODULE": "{MODULE_NAME} 模組有可用更新。",
|
||||||
|
"UPDATE_INFO_SINGLE": "目前版本在 {BRANCH_NAME} 分支上已落後了 {COMMIT_COUNT} 次 commit。",
|
||||||
|
"UPDATE_INFO_MULTIPLE": "目前版本在 {BRANCH_NAME} 分支上已落後了 {COMMIT_COUNT} 次 commit。"
|
||||||
}
|
}
|
||||||
|
14
vendor/package-lock.json
generated
vendored
14
vendor/package-lock.json
generated
vendored
@ -9,7 +9,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^5.15.4",
|
"@fortawesome/fontawesome-free": "^5.15.4",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"moment-timezone": "^0.5.33",
|
"moment-timezone": "^0.5.34",
|
||||||
"nunjucks": "^3.2.3",
|
"nunjucks": "^3.2.3",
|
||||||
"suncalc": "^1.8.0",
|
"suncalc": "^1.8.0",
|
||||||
"weathericons": "^2.1.0"
|
"weathericons": "^2.1.0"
|
||||||
@ -51,9 +51,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/moment-timezone": {
|
"node_modules/moment-timezone": {
|
||||||
"version": "0.5.33",
|
"version": "0.5.34",
|
||||||
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz",
|
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz",
|
||||||
"integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==",
|
"integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"moment": ">= 2.9.0"
|
"moment": ">= 2.9.0"
|
||||||
},
|
},
|
||||||
@ -123,9 +123,9 @@
|
|||||||
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
|
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
|
||||||
},
|
},
|
||||||
"moment-timezone": {
|
"moment-timezone": {
|
||||||
"version": "0.5.33",
|
"version": "0.5.34",
|
||||||
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz",
|
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz",
|
||||||
"integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==",
|
"integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"moment": ">= 2.9.0"
|
"moment": ">= 2.9.0"
|
||||||
}
|
}
|
||||||
|
2
vendor/package.json
vendored
2
vendor/package.json
vendored
@ -12,7 +12,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^5.15.4",
|
"@fortawesome/fontawesome-free": "^5.15.4",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"moment-timezone": "^0.5.33",
|
"moment-timezone": "^0.5.34",
|
||||||
"nunjucks": "^3.2.3",
|
"nunjucks": "^3.2.3",
|
||||||
"suncalc": "^1.8.0",
|
"suncalc": "^1.8.0",
|
||||||
"weathericons": "^2.1.0"
|
"weathericons": "^2.1.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user