Files
gacha-event-tracker/test/reader-servers.test.ts
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

34 lines
1.1 KiB
TypeScript

import { expect, test } from "bun:test";
import { migrateLegacy } from "../src/client/state/reader/migration.ts";
import { createAccount } from "../src/client/state/reader/accounts.ts";
import {
manyServers,
serverSuffix,
} from "../src/client/state/reader/servers.ts";
const at = "2026-10-16T12:00:00.000Z";
test("a server is named only for a game tracked on more than one", () => {
const s = migrateLegacy(
{},
["genshin", "hsr"],
at,
() => `account:${Math.random()}`,
);
expect(manyServers(s, "genshin")).toBe(false);
expect(serverSuffix(s, "genshin", "europe")).toBe("");
s.accounts["account:asia"] = createAccount(
"genshin",
"asia",
at,
"account:asia",
);
expect(serverSuffix(s, "genshin", "asia")).toBe(" · asia");
expect(serverSuffix(s, "hsr", "europe")).toBe("");
// A retired second server stops counting, except where archives ask.
s.accounts["account:asia"] = {
...s.accounts["account:asia"]!,
retiredAt: at,
};
expect(manyServers(s, "genshin")).toBe(false);
expect(manyServers(s, "genshin", true)).toBe(true);
});