| 1234567891011121314151617181920212223242526 |
- import { describe, expect, it } from "vitest";
- import { weatherEffects } from "../src/weather.js";
- describe("weatherEffects (pure weather-id → visual mapping)", () => {
- it("maps rain to the rain particle + rain-tint filter", () => {
- expect(weatherEffects("rain")).toEqual({ particleId: "rain", filterId: "rain-tint" });
- });
- it("maps storm to rain particles + the tint filter + the storm overlay color", () => {
- expect(weatherEffects("storm")).toEqual({ particleId: "rain", filterId: "rain-tint", color: "#2f3b4c" });
- });
- it("maps wind to the wind particle with no filter", () => {
- expect(weatherEffects("wind")).toEqual({ particleId: "wind" });
- });
- it("maps sunny and snow to no visuals", () => {
- expect(weatherEffects("sunny")).toEqual({});
- expect(weatherEffects("snow")).toEqual({});
- });
- it("maps an unknown weather id to {} without crashing", () => {
- expect(weatherEffects("blizzard")).toEqual({});
- expect(weatherEffects("")).toEqual({});
- });
- });
|