mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-26 05:51:17 -07:00
Fix: correct showers WMO weather icons (#6869)
This commit is contained in:
@@ -139,22 +139,22 @@ const conditions = [
|
||||
{
|
||||
code: 80,
|
||||
icon: {
|
||||
day: Icons.WiDaySnow,
|
||||
night: Icons.WiNightAltSnow,
|
||||
day: Icons.WiDaySprinkle,
|
||||
night: Icons.WiNightAltSprinkle,
|
||||
},
|
||||
},
|
||||
{
|
||||
code: 81,
|
||||
icon: {
|
||||
day: Icons.WiDaySnow,
|
||||
night: Icons.WiNightAltSnow,
|
||||
day: Icons.WiDayShowers,
|
||||
night: Icons.WiNightAltShowers,
|
||||
},
|
||||
},
|
||||
{
|
||||
code: 82,
|
||||
icon: {
|
||||
day: Icons.WiDaySnow,
|
||||
night: Icons.WiNightAltSnow,
|
||||
day: Icons.WiDayStormShowers,
|
||||
night: Icons.WiNightAltStormShowers,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -9,6 +9,25 @@ describe("utils/weather/openmeteo-condition-map", () => {
|
||||
expect(mapIcon(95, "night")).toBe(Icons.WiNightAltThunderstorm);
|
||||
});
|
||||
|
||||
it("maps rain shower and snow codes correctly", () => {
|
||||
[80].forEach((code) => {
|
||||
expect(mapIcon(code, "day")).toBe(Icons.WiDaySprinkle);
|
||||
expect(mapIcon(code, "night")).toBe(Icons.WiNightAltSprinkle);
|
||||
});
|
||||
[81].forEach((code) => {
|
||||
expect(mapIcon(code, "day")).toBe(Icons.WiDayShowers);
|
||||
expect(mapIcon(code, "night")).toBe(Icons.WiNightAltShowers);
|
||||
});
|
||||
[82].forEach((code) => {
|
||||
expect(mapIcon(code, "day")).toBe(Icons.WiDayStormShowers);
|
||||
expect(mapIcon(code, "night")).toBe(Icons.WiNightAltStormShowers);
|
||||
});
|
||||
[85, 86].forEach((code) => {
|
||||
expect(mapIcon(code, "day")).toBe(Icons.WiDaySnow);
|
||||
expect(mapIcon(code, "night")).toBe(Icons.WiNightAltSnow);
|
||||
});
|
||||
});
|
||||
|
||||
it("falls back to a default icon for unknown codes", () => {
|
||||
expect(mapIcon(999999, "day")).toBe(Icons.WiDaySunny);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user