weather test for new absolute property

This commit is contained in:
Karsten Hassel 2022-01-07 21:32:12 +01:00
parent 24fccf6c44
commit cd1fe4e182
3 changed files with 44 additions and 0 deletions

View File

@ -11,6 +11,9 @@ _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 absolute porperty.
### Updated ### Updated
### Fixed ### Fixed

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

View File

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