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