mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 03:39:55 +00:00
parent
bf279d9a57
commit
1dc0a0d5b5
@ -29,7 +29,7 @@ _This release is scheduled to be released on 2023-04-01._
|
||||
- Update issue template and contributing doc
|
||||
- The weather modules clearly separates precipation amount and probability (risk of rain/snow)
|
||||
- This requires all providers that only supports probability to change the config from `showPrecipitationAmount` to `showPrecipitationProbability`.
|
||||
- Update weather tests
|
||||
- Update tests for weather and calendar module
|
||||
- Changed updatenotification module for MagicMirror repo only: Send only notifications for `master` if there is a tag on a newer commit
|
||||
- Update dates in Calendar widgets every minute
|
||||
|
||||
|
@ -7,11 +7,8 @@ describe("Calendar module", () => {
|
||||
* @param {string} cssClass css selector
|
||||
*/
|
||||
const doTest = async (cssClass) => {
|
||||
await helpers.getElement(".calendar");
|
||||
await helpers.getElement(".module-content");
|
||||
const events = await global.page.locator(".event");
|
||||
const elem = await events.locator(cssClass);
|
||||
expect(elem).not.toBe(null);
|
||||
let elem = await helpers.getElement(".calendar .module-content .event" + cssClass);
|
||||
expect(await elem.isVisible()).toBe(true);
|
||||
};
|
||||
|
||||
afterEach(async () => {
|
||||
@ -25,7 +22,7 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it("has css class tomorrow", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/custom.js", "31 Dez 2029 12:30:00 GMT");
|
||||
await helpers.startApplication("tests/configs/modules/calendar/custom.js", "31 Dec 2029 12:30:00 GMT");
|
||||
await doTest(".tomorrow");
|
||||
});
|
||||
});
|
||||
|
@ -49,6 +49,11 @@ describe("WeatherObject", () => {
|
||||
});
|
||||
|
||||
describe("WeatherUtils", () => {
|
||||
it("should convert windspeed correctly from mps to beaufort", () => {
|
||||
expect(Math.round(WeatherUtils.convertWind(5, "beaufort"))).toBe(3);
|
||||
expect(Math.round(WeatherUtils.convertWind(42, "beaufort"))).toBe(12);
|
||||
});
|
||||
|
||||
it("should convert windspeed correctly from mph to mps", () => {
|
||||
expect(Math.round(WeatherUtils.convertWindToMetric(93.951324266285))).toBe(42);
|
||||
});
|
||||
@ -64,4 +69,8 @@ describe("WeatherUtils", () => {
|
||||
it("should return a calculated feelsLike info", () => {
|
||||
expect(WeatherUtils.calculateFeelsLike(0, 20, 40)).toBe(-9.444444444444445);
|
||||
});
|
||||
|
||||
it("should return a calculated feelsLike info", () => {
|
||||
expect(WeatherUtils.calculateFeelsLike(30, 0, 60)).toBe(32.8320322777777);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user