feat : add metrial fetcher

This commit is contained in:
2026-09-06 13:59:32 +07:00 Unverified
parent 2808a27406
commit 37d6d6703f
8 changed files with 3827 additions and 8 deletions
+21
View File
@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
import {
avatarIconName,
ascensionSnapshot,
characterDetailSchema,
cleanLunarisText,
constellationSnapshot,
@@ -58,6 +59,26 @@ describe("Lunaris character data", () => {
expect(constellationSnapshot(detail, (icon) => icon)).toEqual([]);
});
it("normalizes scalar and grouped ascension materials", () => {
const detail = characterDetailSchema.parse({
ascension: {
"202": 7049900,
exp: { "104001": 2, "104003": 418 },
},
});
expect(ascensionSnapshot(detail)).toEqual([
{ type: "202", items: [{ key: "202", amount: 7049900 }] },
{
type: "exp",
items: [
{ key: "104001", amount: 2 },
{ key: "104003", amount: 418 },
],
},
]);
});
it("reads the supported weapon type from character details", () => {
const detail = characterDetailSchema.parse({
info: { element: "Cryo", weapon: "WEAPON_SWORD_ONE_HAND" },