feat(guide) : improve extra cards and navigation
CI / Verify (push) Successful in 1m25s
CI / Build immutable images and deploy (push) Failing after 50s

This commit is contained in:
2026-09-04 22:40:27 +07:00 Unverified
parent 5f74ce1de6
commit ced9b41737
16 changed files with 3780 additions and 224 deletions
+8 -7
View File
@@ -139,23 +139,24 @@ describe("structured guide validation", () => {
expect(teamSectionSchema.safeParse(input).success).toBe(true);
});
it("accepts Extra card colors only as a valid pair", () => {
it("validates Extra card backgrounds and word highlights", () => {
const row = {
mediaId: null,
heading: "Extra card",
body: "First line\nSecond line",
percent: null,
};
const input = (colors: { backgroundColor: string | null; textColor: string | null }) => ({
const input = (style: { backgroundColor: string | null; highlights: Array<{ text: string; color: string }> }) => ({
expectedVersion: 1,
sections: [{ title: "Extra", rows: [{ ...row, ...colors }] }],
sections: [{ title: "Extra", rows: [{ ...row, ...style }] }],
});
expect(extraSectionSchema.safeParse(input({ backgroundColor: null, textColor: null })).success).toBe(true);
expect(extraSectionSchema.safeParse(input({ backgroundColor: "#24232C", textColor: "#F5F2EA" })).success).toBe(true);
expect(extraSectionSchema.safeParse(input({ backgroundColor: null, highlights: [] })).success).toBe(true);
expect(extraSectionSchema.safeParse(input({ backgroundColor: "#24232C", highlights: [{ text: "MASSIVE", color: "#FF0000" }] })).success).toBe(true);
expect(extraSectionSchema.safeParse({ expectedVersion: 1, sections: [{ title: "Extra", rows: [row] }] }).success).toBe(true);
expect(extraSectionSchema.safeParse(input({ backgroundColor: "#24232C", textColor: null })).success).toBe(false);
expect(extraSectionSchema.safeParse(input({ backgroundColor: "red", textColor: "#F5F2EA" })).success).toBe(false);
expect(extraSectionSchema.safeParse(input({ backgroundColor: "red", highlights: [] })).success).toBe(false);
expect(extraSectionSchema.safeParse(input({ backgroundColor: null, highlights: [{ text: "MASSIVE", color: "red" }] })).success).toBe(false);
expect(extraSectionSchema.safeParse(input({ backgroundColor: null, highlights: [{ text: "MASSIVE", color: "#FF0000" }, { text: "MASSIVE", color: "#00FF00" }] })).success).toBe(false);
});
});