24 lines
821 B
TypeScript
24 lines
821 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { cleanLunarisText, constellationSnapshot } from "@/lib/catalog/lunaris";
|
|
|
|
describe("Lunaris character data", () => {
|
|
it("removes display markup from constellation text", () => {
|
|
expect(cleanLunarisText('"A {LINK#N1}<color=#fff>bright</color>{/LINK} morning"')).toBe("A bright morning");
|
|
});
|
|
|
|
it("normalizes constellation levels and icon keys", () => {
|
|
const result = constellationSnapshot({
|
|
constellations: {
|
|
const1: { name: '"First"', description: "Detail", icon: "UI_Talent_Test_01" },
|
|
},
|
|
}, (icon) => `catalog/1/constellations/${icon}.webp`);
|
|
expect(result).toEqual([{
|
|
level: 1,
|
|
name: "First",
|
|
description: "Detail",
|
|
iconKey: "catalog/1/constellations/UI_Talent_Test_01.webp",
|
|
}]);
|
|
});
|
|
});
|