import { describe, expect, it } from "vitest"; import { localIsoWithOffset } from "./device-monitor.js"; // The camera clock-sync sends the SITE's wall-clock now with an explicit UTC offset // (ISAPI localTime) — the offset is what makes the instant unambiguous regardless of // the camera's own tz/DST config. Pin the DST both-sides behaviour for the site tz. describe("localIsoWithOffset (camera clock sync payload)", () => { it("Tirane summer = +02:00 (CEST)", () => { expect(localIsoWithOffset("Europe/Tirane", new Date("2026-07-07T10:00:00Z"))).toBe( "2026-07-07T12:00:00+02:00", ); }); it("Tirane winter = +01:00 (CET)", () => { expect(localIsoWithOffset("Europe/Tirane", new Date("2026-01-15T10:00:00Z"))).toBe( "2026-01-15T11:00:00+01:00", ); }); it("UTC = +00:00", () => { expect(localIsoWithOffset("UTC", new Date("2026-07-07T10:00:00Z"))).toBe( "2026-07-07T10:00:00+00:00", ); }); });