feat : update
CI / Verify (push) Successful in 1m16s
CI / Build immutable images and deploy (push) Successful in 1m58s

This commit is contained in:
2026-09-05 22:36:31 +07:00 Unverified
parent 66238795bf
commit 2de07c4917
12 changed files with 637 additions and 146 deletions
+35 -1
View File
@@ -2,7 +2,18 @@ import { describe, expect, it } from "vitest";
import { calculateTeamMetrics } from "@/lib/guides/calculations";
import { createExtraSheet } from "@/lib/guides/extra-sheet";
import { artifactSectionSchema, constellationSectionSchema, createGuideSchema, extraSectionSchema, teamSectionSchema, updateGuideSchema, weaponSectionSchema } from "@/lib/guides/schemas";
import {
artifactSectionSchema,
constellationSectionSchema,
createExtraSectionSchema,
createGuideSchema,
extraSectionSchema,
reorderExtraSectionsSchema,
saveExtraSectionSchema,
teamSectionSchema,
updateGuideSchema,
weaponSectionSchema,
} from "@/lib/guides/schemas";
import {
recommendedStatElement,
recommendedStatIconName,
@@ -245,6 +256,29 @@ describe("structured guide validation", () => {
sections: [{ title: "Extra", rows: [{ ...row, sheet: invalidSheet }] }],
}).success).toBe(false);
});
it("validates targeted Extra create, save, and reorder inputs", () => {
const section = {
title: "Build notes",
rows: [{
mediaId: null,
heading: "Rotation",
body: "",
percent: null,
backgroundColor: null,
highlights: [],
catalogItems: [],
sheet: null,
}],
};
const firstId = "550e8400-e29b-41d4-a716-446655440000";
const secondId = "d9428888-122b-11e1-b85c-61cd3cbb3210";
expect(createExtraSectionSchema.parse({ title: " Build notes " }).title).toBe("Build notes");
expect(saveExtraSectionSchema.safeParse({ expectedVersion: 2, section }).success).toBe(true);
expect(reorderExtraSectionsSchema.safeParse({ expectedVersion: 2, sectionIds: [firstId, secondId] }).success).toBe(true);
expect(reorderExtraSectionsSchema.safeParse({ expectedVersion: 2, sectionIds: [firstId, firstId] }).success).toBe(false);
});
});
describe("Team Calc", () => {