feat : add metrial fetcher
This commit is contained in:
@@ -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" },
|
||||
|
||||
Reference in New Issue
Block a user