Files
gacha-event-tracker/test/redesign-time-settings.test.tsx
T
Lucas WintherandClaude Opus 5.5 50c6e91b00 feat: the redesigned Event Clock
The new reader app replaces the old UI: Checklist with a rail (focus
pills, Next to expire, today's dailies, pinned routines), Timeline in a
new and a classic look, Routines, Archive and a Settings area, in a
Structured (default) and a Relaxed interface. It follows the approved
Round 6 B and Round 7 mockups, corrected screen by screen with the owner.

Reader data moves to a v2 store (gacha-tracker:v2:*). Existing v1 data
is migrated on first load, a recovery copy is written first, and the v1
keys are never removed, so a rollback finds them unchanged. Redeem codes
for Genshin arrive as their own feed.

Also: live's urgency ramp, editable per theme; completion and
section-complete fireworks; a returning-user tour; the design mockups,
specs, plans, reviews and handoff record.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 01:55:16 +02:00

49 lines
1.5 KiB
TypeScript

import { expect, test } from "bun:test";
import { renderToStaticMarkup as render } from "react-dom/server";
import {
zoneGroups,
zoneName,
} from "../src/client/components/redesign/TimezoneSelect.tsx";
import { TimeSettings } from "../src/client/components/redesign/TimeSettings.tsx";
import { migrateLegacy } from "../src/client/state/reader/migration.ts";
test("zones read as cities, grouped by region", () => {
expect(zoneName("Europe/Copenhagen")).toBe("Copenhagen");
expect(zoneName("America/Argentina/Buenos_Aires")).toBe(
"Buenos Aires, Argentina",
);
const groups = zoneGroups([
"Europe/Paris",
"UTC",
"Asia/Tokyo",
"Europe/Berlin",
]);
expect(groups.map((g) => g.group)).toEqual(["Europe", "Asia", "Other"]);
expect(groups[0]!.zones.map((z) => z.name)).toEqual(["Berlin", "Paris"]);
});
test("Region & time has one timezone list, no search box, and a reset row per server", () => {
const at = "2026-10-16T12:00:00.000Z";
const s = migrateLegacy(
{},
["genshin", "hsr"],
at,
(() => {
let n = 0;
return () => `account:a${++n}`;
})(),
);
const html = render(
<TimeSettings
state={s}
now={Date.parse(at)}
onAction={async () => ({ ok: true })}
/>,
);
expect(html).not.toContain('type="search"');
expect(html).toContain('<optgroup label="Europe">');
expect(html).toContain("Currently displaying");
expect(html.match(/class="reset-row"/g)?.length).toBe(2);
expect(html).toContain("Reset timing for your games");
});