Add option to show hourly forecast in increments (#2998)

Adds new config option to show weather forecast for every X hour
(default value is 1 which reflects the current behaviour)
Also adds tests for hourly forecast
Fixes #2996

Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
Veeck
2023-01-10 18:55:07 +01:00
committed by GitHub
parent 7bc91a742f
commit 6e80e5a295
8 changed files with 1237 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
const helpers = require("./global-setup");
const path = require("path");
const fs = require("fs");
const { generateWeather, generateWeatherForecast } = require("../../mocks/weather_test");
const { generateWeather, generateWeatherForecast, generateWeatherHourly } = require("../../mocks/weather_test");
exports.getText = async (element, result) => {
const elem = await helpers.waitForElement(element);
@@ -18,6 +18,8 @@ exports.startApp = async (configFile, additionalMockData) => {
let mockWeather;
if (configFile.includes("forecast")) {
mockWeather = generateWeatherForecast(additionalMockData);
} else if (configFile.includes("hourly")) {
mockWeather = generateWeatherHourly(additionalMockData);
} else {
mockWeather = generateWeather(additionalMockData);
}