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

56 lines
1.6 KiB
TypeScript

import { expect, test } from "bun:test";
import { parseRoute, routeHash } from "../src/client/state/route.ts";
test("pages round-trip through the address bar", () => {
for (const route of [
{ page: "soon" },
{ page: "timeline" },
{ page: "routines" },
{ page: "archive" },
{ page: "settings", settings: "changelog" },
{ page: "settings", settings: "games", game: "genshin" },
] as const)
expect(parseRoute(routeHash(route))).toEqual(route);
expect(routeHash({ page: "soon" })).toBe("#checklist");
expect(routeHash({ page: "settings", settings: "about" })).toBe(
"#settings/about",
);
});
test("an unknown or empty hash is no route, so the default view applies", () => {
for (const hash of [
"",
"#",
"#nowhere",
"#settings/nope",
"#settings/games/",
])
expect(parseRoute(hash)).toBeNull();
// A settings hash without a section opens the default section.
expect(parseRoute("#settings")).toEqual({
page: "settings",
settings: "appearance",
});
});
test("the old Default view address opens Appearance, where it moved", () => {
expect(parseRoute("#settings/general")).toEqual({
page: "settings",
settings: "appearance",
});
});
test("the old Lists address opens Data & sources, where its options moved", () => {
expect(parseRoute("#settings/lists")).toEqual({
page: "settings",
settings: "sources",
});
});
test("the games address without a game opens Appearance, where game order lives", () => {
expect(parseRoute("#settings/games")).toEqual({
page: "settings",
settings: "appearance",
});
});