feat : excel in website
CI / Verify (push) Successful in 1m15s
CI / Build immutable images and deploy (push) Successful in 4m53s

This commit is contained in:
2026-09-05 15:04:14 +07:00 Unverified
parent c19cbe6537
commit e66b5a3a0d
18 changed files with 4386 additions and 83 deletions
+32
View File
@@ -1,6 +1,7 @@
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 {
recommendedStatElement,
@@ -207,6 +208,37 @@ describe("structured guide validation", () => {
sections: [{ title: "Extra", rows: [{ ...row, catalogItems: [row.catalogItems[0], row.catalogItems[0]] }] }],
}).success).toBe(false);
});
it("validates an optional Extra card sheet", () => {
let id = 0;
const sheet = createExtraSheet((prefix) => `${prefix}-${++id}`);
sheet.rows[0].cells[sheet.columns[0].id] = "=1+1";
const row = {
mediaId: null,
heading: "Stats",
body: "",
percent: null,
backgroundColor: null,
highlights: [],
catalogItems: [],
sheet,
};
const result = extraSectionSchema.safeParse({
expectedVersion: 1,
sections: [{ title: "Extra", rows: [row] }],
});
expect(result.success).toBe(true);
if (result.success) {
expect(result.data.sections[0].rows[0].sheet?.rows[0].cells[sheet.columns[0].id]).toBe("=1+1");
}
const invalidSheet = structuredClone(sheet);
invalidSheet.rows[0].cells.missing = "orphan";
expect(extraSectionSchema.safeParse({
expectedVersion: 1,
sections: [{ title: "Extra", rows: [{ ...row, sheet: invalidSheet }] }],
}).success).toBe(false);
});
});
describe("Team Calc", () => {