Files
gacha-event-tracker/test/codes-ui.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

42 lines
1.3 KiB
TypeScript

import { expect, test } from "bun:test";
import { renderToStaticMarkup as render } from "react-dom/server";
import { CodesPage } from "../src/client/components/redesign/CodesPage.tsx";
import { migrateLegacy } from "../src/client/state/reader/migration.ts";
import { createAccount } from "../src/client/state/reader/accounts.ts";
test("redemption controls identify each server and unknown expiry stays unknown", () => {
const at = "2026-10-16T12:00:00.000Z",
s = migrateLegacy({}, ["genshin"], at, () => "account:test");
s.accounts["account:two"] = createAccount(
"genshin",
"asia",
at,
"account:two",
);
const html = render(
<CodesPage
game="genshin"
state={s}
onAction={async () => ({ ok: true })}
feed={{
schemaVersion: 1,
sources: [],
codes: [
{
id: "code",
game: "genshin",
code: "TEST",
reward: null,
expiresAt: null,
firstObservedAt: at,
sourceUrl: "https://example.com",
},
],
}}
/>,
);
expect(html).toContain("Redeemed · europe");
expect(html).toContain("Redeemed · asia");
expect(html).toContain("Expiry not announced");
expect(html).toContain('href="https://example.com"');
});