feat(admin) : streamline team editing and delete safety
This commit is contained in:
@@ -18,6 +18,12 @@ describe("structured guide validation", () => {
|
||||
expect(weaponSectionSchema.safeParse({ expectedVersion: 1, note: null, rows: [{ weaponKey: "1", refinement: 5, overallPercent: 104, personalPercent: null, note: "Best free-to-play option" }] }).success).toBe(true);
|
||||
});
|
||||
|
||||
it("preserves negative weapon percentages", () => {
|
||||
const result = weaponSectionSchema.safeParse({ expectedVersion: 1, note: null, rows: [{ weaponKey: "1", refinement: 5, overallPercent: -12.5, personalPercent: null, note: null }] });
|
||||
expect(result.success).toBe(true);
|
||||
if (result.success) expect(result.data.rows[0].overallPercent).toBe(-12.5);
|
||||
});
|
||||
|
||||
it("limits an optional note on each weapon", () => {
|
||||
const row = { weaponKey: "1", refinement: 1, overallPercent: 100, personalPercent: null };
|
||||
expect(weaponSectionSchema.safeParse({ expectedVersion: 1, note: null, rows: [{ ...row, note: null }] }).success).toBe(true);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { targetStatOptions } from "@/lib/guides/stats";
|
||||
export const guideSectionKinds = ["weapon", "artifact", "constellations", "team"] as const;
|
||||
export type GuideSectionKind = (typeof guideSectionKinds)[number];
|
||||
|
||||
const percent = z.coerce.number().finite().min(0).max(9999);
|
||||
const percent = z.coerce.number().finite().min(-9999).max(9999);
|
||||
const catalogKey = z.string().trim().min(1).max(64);
|
||||
|
||||
export const createGuideSchema = z.strictObject({
|
||||
|
||||
Reference in New Issue
Block a user