mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Merge branch 'develop' into patch-1
This commit is contained in:
commit
9e4997aa81
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
|
|
||||||
|
@ -11,8 +11,14 @@ _This release is scheduled to be released on 2022-04-01._
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
- 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.
|
||||||
|
- 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.
|
||||||
- updates Font Awesome css class to new default style (fixes #2768)
|
- updates Font Awesome css class to new default style (fixes #2768)
|
||||||
|
|
||||||
### 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!
|
||||||
|
|
||||||
|
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 }));
|
||||||
|
|
||||||
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) {
|
||||||
/**
|
/**
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
{% set forecast = forecast.slice(0, numSteps) %}
|
{% set forecast = forecast.slice(0, numSteps) %}
|
||||||
{% for f in forecast %}
|
{% for f in forecast %}
|
||||||
<tr {% if config.colored %}class="colored"{% endif %} {% if config.fade %}style="opacity: {{ currentStep | opacity(numSteps) }};"{% endif %}>
|
<tr {% if config.colored %}class="colored"{% endif %} {% if config.fade %}style="opacity: {{ currentStep | opacity(numSteps) }};"{% endif %}>
|
||||||
{% if (currentStep == 0) and config.ignoreToday == false %}
|
{% if (currentStep == 0) and config.ignoreToday == false and config.absoluteDates == false %}
|
||||||
<td class="day">{{ "TODAY" | translate }}</td>
|
<td class="day">{{ "TODAY" | translate }}</td>
|
||||||
{% elif (currentStep == 1) and config.ignoreToday == false %}
|
{% elif (currentStep == 1) and config.ignoreToday == false and config.absoluteDates == false %}
|
||||||
<td class="day">{{ "TOMORROW" | translate }}</td>
|
<td class="day">{{ "TOMORROW" | translate }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td class="day">{{ f.date.format('ddd') }}</td>
|
<td class="day">{{ f.date.format('ddd') }}</td>
|
||||||
|
@ -43,7 +43,8 @@ Module.register("weather", {
|
|||||||
onlyTemp: false,
|
onlyTemp: false,
|
||||||
showPrecipitationAmount: false,
|
showPrecipitationAmount: false,
|
||||||
colored: false,
|
colored: false,
|
||||||
showFeelsLike: true
|
showFeelsLike: true,
|
||||||
|
absoluteDates: false
|
||||||
},
|
},
|
||||||
|
|
||||||
// Module properties.
|
// Module properties.
|
||||||
|
2034
package-lock.json
generated
2034
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
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",
|
||||||
@ -94,7 +94,8 @@
|
|||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"verbose": true,
|
"verbose": true,
|
||||||
"testTimeout": 10000,
|
"testTimeout": 15000,
|
||||||
|
"testSequencer": "<rootDir>/tests/configs/test_sequencer.js",
|
||||||
"projects": [
|
"projects": [
|
||||||
{
|
{
|
||||||
"displayName": "unit",
|
"displayName": "unit",
|
||||||
|
27
tests/configs/modules/weather/forecastweather_absolute.js
Normal file
27
tests/configs/modules/weather/forecastweather_absolute.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/* Magic Mirror Test config default weather
|
||||||
|
*
|
||||||
|
* By fewieden https://github.com/fewieden
|
||||||
|
* MIT Licensed.
|
||||||
|
*/
|
||||||
|
let config = {
|
||||||
|
timeFormat: 12,
|
||||||
|
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
module: "weather",
|
||||||
|
position: "bottom_bar",
|
||||||
|
config: {
|
||||||
|
type: "forecast",
|
||||||
|
location: "Munich",
|
||||||
|
mockData: '"#####WEATHERDATA#####"',
|
||||||
|
weatherEndpoint: "/forecast/daily",
|
||||||
|
absoluteDates: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||||
|
if (typeof module !== "undefined") {
|
||||||
|
module.exports = config;
|
||||||
|
}
|
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;
|
@ -1,5 +1,6 @@
|
|||||||
const helpers = require("../global-setup");
|
const helpers = require("../global-setup");
|
||||||
const serverBasicAuth = require("./basic-auth.js");
|
const serverBasicAuth = require("./basic-auth.js");
|
||||||
|
const testDelay = 4000;
|
||||||
|
|
||||||
describe("Calendar module", function () {
|
describe("Calendar module", function () {
|
||||||
/**
|
/**
|
||||||
@ -24,7 +25,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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the default maximumEntries of 10", () => {
|
it("should show the default maximumEntries of 10", () => {
|
||||||
@ -39,7 +40,7 @@ describe("Calendar module", function () {
|
|||||||
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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the custom maximumEntries of 4", () => {
|
it("should show the custom maximumEntries of 4", () => {
|
||||||
@ -62,7 +63,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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the recurring birthday event 6 times", () => {
|
it("should show the recurring birthday event 6 times", () => {
|
||||||
@ -78,7 +79,7 @@ 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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should contain text "Mar 25th" in timezone UTC ' + -i, () => {
|
it('should contain text "Mar 25th" in timezone UTC ' + -i, () => {
|
||||||
@ -93,7 +94,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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(function (done) {
|
afterAll(function (done) {
|
||||||
@ -108,7 +109,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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should return TestEvents", function () {
|
it("should return TestEvents", function () {
|
||||||
@ -119,7 +120,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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should return TestEvents", function () {
|
it("should return TestEvents", function () {
|
||||||
@ -130,7 +131,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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should return TestEvents", function () {
|
it("should return TestEvents", function () {
|
||||||
@ -142,7 +143,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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(function (done) {
|
afterAll(function (done) {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
const helpers = require("../global-setup");
|
const helpers = require("../global-setup");
|
||||||
|
const testDelay = 4000;
|
||||||
|
|
||||||
describe("Newsfeed module", function () {
|
describe("Newsfeed module", function () {
|
||||||
afterAll(function () {
|
afterAll(function () {
|
||||||
@ -8,7 +9,7 @@ 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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the newsfeed title", function () {
|
it("should show the newsfeed title", function () {
|
||||||
@ -32,7 +33,7 @@ describe("Newsfeed module", function () {
|
|||||||
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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not show articles with prohibited words", function () {
|
it("should not show articles with prohibited words", function () {
|
||||||
@ -51,7 +52,7 @@ describe("Newsfeed module", function () {
|
|||||||
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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show malformed url warning", function () {
|
it("should show malformed url warning", function () {
|
||||||
@ -64,7 +65,7 @@ describe("Newsfeed module", function () {
|
|||||||
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, testDelay);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show empty items info message", function () {
|
it("should show empty items info message", function () {
|
||||||
|
@ -210,6 +210,20 @@ describe("Weather module", function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("Absolute configuration", function () {
|
||||||
|
beforeAll(function (done) {
|
||||||
|
startApp("tests/configs/modules/weather/forecastweather_absolute.js", {}, done);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should render days", function () {
|
||||||
|
const days = ["Fri", "Sat", "Sun", "Mon", "Tue"];
|
||||||
|
|
||||||
|
for (const [index, day] of days.entries()) {
|
||||||
|
getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(1)`, day);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("Configuration Options", function () {
|
describe("Configuration Options", function () {
|
||||||
beforeAll(function (done) {
|
beforeAll(function (done) {
|
||||||
startApp("tests/configs/modules/weather/forecastweather_options.js", {}, done);
|
startApp("tests/configs/modules/weather/forecastweather_options.js", {}, done);
|
||||||
|
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