diff --git a/tests/configs/modules/weather/forecastweather_options.js b/tests/configs/modules/weather/forecastweather_options.js new file mode 100644 index 00000000..cc1b8773 --- /dev/null +++ b/tests/configs/modules/weather/forecastweather_options.js @@ -0,0 +1,40 @@ +/* Magic Mirror Test config default weather + * + * By fewieden https://github.com/fewieden + * + * MIT Licensed. + */ + +let config = { + port: 8080, + ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], + + language: "en", + timeFormat: 12, + units: "metric", + electronOptions: { + webPreferences: { + nodeIntegration: true, + }, + }, + + modules: [ + { + module: "weather", + position: "bottom_bar", + config: { + type: "forecast", + location: "Munich", + apiKey: "fake key", + weatherEndpoint: "/forecast/daily", + initialLoadDelay: 3000, + showPrecipitationAmount: true, + colored: true, + tableClass: "myTableClass" + } + } + ] +}; + +/*************** DO NOT EDIT THE LINE BELOW ***************/ +if (typeof module !== "undefined") {module.exports = config;} diff --git a/tests/e2e/modules/weather_spec.js b/tests/e2e/modules/weather_spec.js index 47c9e58f..abe4e3a0 100644 --- a/tests/e2e/modules/weather_spec.js +++ b/tests/e2e/modules/weather_spec.js @@ -242,5 +242,18 @@ describe("Weather module", function() { } }); }); + + describe("Configuration Options", function() { + before(function() { + process.env.MM_CONFIG_FILE = "tests/configs/modules/weather/forecastweather_options.js"; + }); + + it("should render custom table class", async function() { + const weather = generateWeatherForecast(); + await setup([weather, template]); + + await app.client.waitForExist(`.weather table.myTableClass`, 10000); + }); + }); }); });