import { render, screen } from "@testing-library/react"; import { describe, expect, it } from "vitest"; import { EntryTimestamp, formatShortLocalTime } from "./EntryTimestamp"; describe("EntryTimestamp", () => { it("shows a stable local HH:mm and exposes the full zoned date", () => { const atMs = Date.UTC(2026, 8, 10, 12, 37); render(); const timestamp = screen.getByText(formatShortLocalTime(atMs)!); expect(timestamp.getAttribute("title")).toBeTruthy(); expect(timestamp.getAttribute("tabindex")).toBe("0"); }); it("does not invent a timestamp for legacy entries", () => { render(); expect(screen.getByLabelText("Heure indisponible").textContent).toBe("—"); }); });