feat(guides): autosave structured guide data
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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",
|
||||
}]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user