| ... | ... | @@ -52,6 +52,25 @@ describe("formatShortTimestamp", () => { |
| 52 | 52 | }); |
| 53 | 53 | }); |
| 54 | 54 | |
| 55 | describe("formatChatTimestampTooltip", () => { |
| 56 | afterEach(() => { |
| 57 | vi.restoreAllMocks(); |
| 58 | vi.resetModules(); |
| 59 | }); |
| 60 | |
| 61 | it.each(["de-DE", "it-IT"])("keeps the English date label in a %s runtime", async (locale) => { |
| 62 | const DateTimeFormat = Intl.DateTimeFormat; |
| 63 | vi.spyOn(Intl, "DateTimeFormat").mockImplementation(function (locales, options) { |
| 64 | return new DateTimeFormat(locales ?? locale, options); |
| 65 | }); |
| 66 | vi.resetModules(); |
| 67 | const { formatChatTimestampTooltip: format } = await import("./timestampFormat"); |
| 68 | const date = new Date(2026, 5, 4, 14, 4).toISOString(); |
| 69 | |
| 70 | expect(format(date, "24-hour")).toBe("14:04, 4th June 2026"); |
| 71 | }); |
| 72 | }); |
| 73 | |
| 55 | 74 | describe("formatExpiresInLabel", () => { |
| 56 | 75 | beforeEach(() => { |
| 57 | 76 | vi.useFakeTimers(); |