import { describe, expect, it } from "vitest"; import complexAssetCatalog from "../../apps/web/src/generated/complex-assets.json"; import { P0A_COLOR_CARD_IDS, P0A_DYNAMIC_STICKER_IDS, P0A_REQUIRED_FONT_PANEL_IDS, P0A_TEXT_TEMPLATE_IDS, } from "../../packages/template-registry/src/index.js"; describe("POSTV1-ASSET-ALL-16 complete asset catalog", () => { it("publishes every normalized complex asset instead of the original alpha subset", () => { expect(P0A_TEXT_TEMPLATE_IDS).toHaveLength(332); expect(P0A_TEXT_TEMPLATE_IDS[0]).toBe("FLOWER001"); expect(P0A_TEXT_TEMPLATE_IDS.at(-1)).toBe("SIMPLE017"); expect(P0A_REQUIRED_FONT_PANEL_IDS).toHaveLength(86); expect(P0A_REQUIRED_FONT_PANEL_IDS[0]).toBe("FONT001"); expect(P0A_REQUIRED_FONT_PANEL_IDS.at(-1)).toBe("FONT086"); expect(P0A_COLOR_CARD_IDS).toHaveLength(16); expect(P0A_COLOR_CARD_IDS[0]).toBe("COLOR001"); expect(P0A_COLOR_CARD_IDS.at(-1)).toBe("COLOR016"); expect(P0A_DYNAMIC_STICKER_IDS).toHaveLength(35); expect(P0A_DYNAMIC_STICKER_IDS[0]).toBe("DYN001"); expect(P0A_DYNAMIC_STICKER_IDS.at(-1)).toBe("DYN035"); }); it("generates a sanitized browser catalog for every text, font, and dynamic definition", () => { expect(complexAssetCatalog.schema_version).toBe("DadaComplexBrowserCatalog/v1"); expect(complexAssetCatalog.text_templates).toHaveLength(332); expect(complexAssetCatalog.font_panel_items).toHaveLength(86); expect(complexAssetCatalog.dynamic_stickers).toHaveLength(35); expect(complexAssetCatalog.text_templates.filter((item) => item.preview_asset_id)).toHaveLength(261); expect(complexAssetCatalog.text_templates.every((item) => item.available)).toBe(true); expect(JSON.stringify(complexAssetCatalog)).not.toMatch(/[A-Z]:[\\/]/i); }); });