feat : big update
CI / Verify (push) Successful in 51s
CI / Build immutable images and deploy (push) Successful in 1m36s

This commit is contained in:
2026-08-30 10:52:37 +00:00 Unverified
parent 0a643dd60e
commit 273baa55d8
22 changed files with 4025 additions and 87 deletions
+21
View File
@@ -6,6 +6,7 @@ import {
cleanLunarisText,
constellationSnapshot,
supportsWeaponType,
talentSnapshot,
} from "@/lib/catalog/lunaris";
describe("Lunaris character data", () => {
@@ -19,6 +20,10 @@ describe("Lunaris character data", () => {
expect(cleanLunarisText('"A {LINK#N1}<color=#fff>bright</color>{/LINK} morning"')).toBe("A bright morning");
});
it("converts escaped Lunaris newlines into displayable lines", () => {
expect(cleanLunarisText("First line\\n\\n<i>Second line</i>")).toBe("First line\n\nSecond line");
});
it("normalizes constellation levels and icon keys", () => {
const result = constellationSnapshot({
constellations: {
@@ -49,6 +54,22 @@ describe("Lunaris character data", () => {
expect(detail.info?.element).toBe("Cryo");
});
it("maps normal, skill, and burst talent metadata", () => {
const detail = characterDetailSchema.parse({
skills: {
normalattack: { name: "Normal", description: "Line 1\\nLine 2", icon: "Skill_A_Test" },
elementalskill: { name: "Skill", description: "Skill detail", icon: "Skill_S_Test" },
elementalburst: { name: "Burst", description: "Burst detail", icon: "Skill_E_Test" },
},
});
expect(talentSnapshot(detail, (icon) => `${icon}.webp`)).toEqual([
{ type: "NA", name: "Normal", description: "Line 1\nLine 2", iconKey: "Skill_A_Test.webp" },
{ type: "E", name: "Skill", description: "Skill detail", iconKey: "Skill_S_Test.webp" },
{ type: "Q", name: "Burst", description: "Burst detail", iconKey: "Skill_E_Test.webp" },
]);
});
it("matches only weapons supported by the character", () => {
expect(
supportsWeaponType("WEAPON_SWORD_ONE_HAND", "WEAPON_SWORD_ONE_HAND"),