mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Merge pull request #2773 from khassel/weather-test-absolute
This commit is contained in:
commit
ad66c02735
@ -12,6 +12,7 @@ _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 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.
|
||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"verbose": true,
|
"verbose": true,
|
||||||
"testTimeout": 10000,
|
"testTimeout": 15000,
|
||||||
"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;
|
||||||
|
}
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user