Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ _This release is scheduled to be released on 2022-04-01._
### 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.

### Updated

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
},
"jest": {
"verbose": true,
"testTimeout": 10000,
"testTimeout": 15000,
"projects": [
{
"displayName": "unit",
Expand Down
27 changes: 27 additions & 0 deletions tests/configs/modules/weather/forecastweather_absolute.js
Original file line number Diff line number Diff line change
@@ -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;
}
14 changes: 14 additions & 0 deletions tests/e2e/modules/weather_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
beforeAll(function (done) {
startApp("tests/configs/modules/weather/forecastweather_options.js", {}, done);
Expand Down