feat : update
CI / Verify (push) Successful in 52s
CI / Build immutable images and deploy (push) Successful in 1m34s

This commit is contained in:
2026-08-30 11:04:34 +00:00 Unverified
parent 273baa55d8
commit fd3472bc8d
7 changed files with 41 additions and 10 deletions
+6
View File
@@ -29,6 +29,12 @@ describe("structured guide validation", () => {
expect(artifactSectionSchema.safeParse({ ...base, groups: [...artifactGroups, { name: "Other", rows: [] }] }).success).toBe(false);
});
it("accepts only talent target levels from 1 through 10", () => {
const base = { expectedVersion: 1, groups: artifactGroups, sands: [], goblet: [], circlet: [], substats: [], targets: [], note: null };
expect(artifactSectionSchema.safeParse({ ...base, talents: [{ type: "NA", priority: 1, level: "10" }] }).success).toBe(true);
expect(artifactSectionSchema.safeParse({ ...base, talents: [{ type: "NA", priority: 1, level: "11" }] }).success).toBe(false);
});
it("requires four unique team members and non-zero damage", () => {
const member = (characterKey: string) => ({ characterKey, weaponKey: null, artifactKey: null, constellation: 0, refinement: 1, damage: 100 });
const base = { expectedVersion: 1, teams: [{ title: "Test", rotationSeconds: 20, combo: "E > Q", members: ["1", "2", "3", "4"].map(member) }] };
+2 -1
View File
@@ -37,6 +37,7 @@ export const mainStatOptions = {
} as const;
export const substatOptions = ["CRIT Rate%/CRIT DMG%", "HP%", "ATK%", "DEF%", "EM", "ER"] as const;
export const talentLevelOptions = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"] as const;
const artifactGroupSchema = (name: "Late Game" | "Early Game") => z.strictObject({
name: z.literal(name),
@@ -64,7 +65,7 @@ export const artifactSectionSchema = z.strictObject({
talents: z.array(z.strictObject({
type: z.enum(["NA", "E", "Q"]),
priority: z.number().int().min(1).max(3),
level: z.string().trim().max(24).optional(),
level: z.enum(talentLevelOptions).optional(),
})).max(3),
note: z.string().trim().max(2_000).nullable(),
});