feat(characters): use local character catalog

This commit is contained in:
2026-07-17 16:03:18 +08:00
parent a210a98d98
commit b3ebd5cf3b
96 changed files with 1023 additions and 522 deletions
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { ROUTES } from "@/router/routes";
import { getCharacterRoutes, ROUTES } from "@/router/routes";
import {
resolveExternalEntryDestination,
@@ -33,7 +33,21 @@ describe("external entry navigation", () => {
});
it("routes every tip entry to the tier selection page", () => {
expect(resolveExternalEntryDestination({ target: "tip" })).toBe("/tip");
expect(resolveExternalEntryDestination({ target: "tip" })).toBe(
getCharacterRoutes("elio").tip,
);
});
it("uses a known character slug and falls back to Elio", () => {
expect(
resolveExternalEntryDestination({ target: "chat", character: "maya" }),
).toBe(getCharacterRoutes("maya").chat);
expect(
resolveExternalEntryDestination({
target: "private-room",
character: "unknown",
}),
).toBe(getCharacterRoutes("elio").privateRoom);
});
});