feat(POSTV1-ASSET-ALL-16): 发布完整素材注册清单
Dada P0-A isolated Windows CI / validate-and-package (push) Waiting to run
Dada P0-A isolated Windows CI / validate-and-package (push) Waiting to run
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
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");
|
||||
});
|
||||
});
|
||||
@@ -7,6 +7,7 @@ import type { StaticStickerCatalog } from "../../packages/static-sticker-catalog
|
||||
import {
|
||||
P0A_COLOR_CARD_IDS,
|
||||
P0A_DYNAMIC_STICKER_IDS,
|
||||
P0A_REQUIRED_FONT_PANEL_IDS,
|
||||
P0A_TEXT_TEMPLATE_IDS,
|
||||
createP0aPublicManifest,
|
||||
} from "../../packages/template-registry/src/index.js";
|
||||
@@ -116,29 +117,27 @@ function evidence(name: string, value: unknown) {
|
||||
writeFileSync(resolve(root, name), `${JSON.stringify(value, null, 2)}\n`);
|
||||
}
|
||||
|
||||
describe("TDD-WP5-WHITE-001 P0-A public allowlist", () => {
|
||||
it("registers the complete archive while publishing only the exact P0-A allowlist", () => {
|
||||
describe("TDD-WP5-WHITE-001 complete public catalog", () => {
|
||||
it("registers and publishes the complete normalized archive", () => {
|
||||
const source = fullComplexManifest();
|
||||
const before = structuredClone(source);
|
||||
const manifest = createP0aPublicManifest({ complexManifest: source, staticCatalog: staticCatalog() });
|
||||
|
||||
expect(source).toEqual(before);
|
||||
expect(P0A_TEXT_TEMPLATE_IDS).toHaveLength(32);
|
||||
expect(P0A_COLOR_CARD_IDS).toEqual(["COLOR001", "COLOR002", "COLOR008", "COLOR016"]);
|
||||
expect(P0A_DYNAMIC_STICKER_IDS).toEqual([
|
||||
"DYN001", "DYN002", "DYN003", "DYN004", "DYN007",
|
||||
"DYN008", "DYN011", "DYN012", "DYN015", "DYN016",
|
||||
]);
|
||||
expect(P0A_TEXT_TEMPLATE_IDS).toHaveLength(332);
|
||||
expect(P0A_REQUIRED_FONT_PANEL_IDS).toHaveLength(86);
|
||||
expect(P0A_COLOR_CARD_IDS).toHaveLength(16);
|
||||
expect(P0A_DYNAMIC_STICKER_IDS).toHaveLength(35);
|
||||
expect(manifest.counts).toEqual({
|
||||
color_cards: 4,
|
||||
dynamic_stickers: 10,
|
||||
font_panel_items: 11,
|
||||
color_cards: 16,
|
||||
dynamic_stickers: 35,
|
||||
font_panel_items: 86,
|
||||
static_parts: 25,
|
||||
static_stickers: 1_407,
|
||||
text_templates: 32,
|
||||
text_templates: 332,
|
||||
});
|
||||
expect(manifest.assets.text_templates.map((item) => item.canonical_id)).toEqual(P0A_TEXT_TEMPLATE_IDS);
|
||||
expect(manifest.assets.font_panel_items.map((item) => item.canonical_id)).toEqual([...referencedFontIds, "FONT081"]);
|
||||
expect(manifest.assets.font_panel_items.map((item) => item.canonical_id)).toEqual(P0A_REQUIRED_FONT_PANEL_IDS);
|
||||
expect(manifest.assets.color_cards.map((item) => item.canonical_id)).toEqual(P0A_COLOR_CARD_IDS);
|
||||
expect(manifest.assets.dynamic_stickers.map((item) => item.canonical_id)).toEqual(P0A_DYNAMIC_STICKER_IDS);
|
||||
expect(manifest.assets.static_stickers).toHaveLength(1_407);
|
||||
@@ -154,10 +153,10 @@ describe("TDD-WP5-WHITE-001 P0-A public allowlist", () => {
|
||||
&& item.release_tier === "alpha_whitelist"
|
||||
&& item.validation_status === "passed")).toBe(true);
|
||||
const serialized = JSON.stringify(manifest);
|
||||
expect(serialized).not.toContain("FLOWER009");
|
||||
expect(serialized).not.toContain("COLOR003");
|
||||
expect(serialized).not.toContain("DYN005");
|
||||
evidence("unit-allowlist.json", { counts: manifest.counts, hidden: ["FLOWER009", "COLOR003", "DYN005"], status: "passed" });
|
||||
expect(serialized).toContain("FLOWER145");
|
||||
expect(serialized).toContain("COLOR016");
|
||||
expect(serialized).toContain("DYN035");
|
||||
evidence("unit-full-catalog.json", { counts: manifest.counts, status: "passed" });
|
||||
});
|
||||
|
||||
it("rejects incomplete registration and any early full_p0 enablement", () => {
|
||||
@@ -172,12 +171,12 @@ describe("TDD-WP5-WHITE-001 P0-A public allowlist", () => {
|
||||
});
|
||||
|
||||
describe("TDD-WP5-COL-001 shared five-color renderer input", () => {
|
||||
it("binds the four enabled layouts to one immutable palette snapshot", () => {
|
||||
it("binds all sixteen layouts to one immutable palette snapshot", () => {
|
||||
const palette = ["#102030", "#405060", "#708090", "#A0B0C0", "#D0E0F0"] as const;
|
||||
const plans = createP0aColorCardRenderPlans(palette);
|
||||
expect(P0A_COLOR_CARD_DEFINITIONS.map((item) => [item.cardId, item.styleId])).toEqual([
|
||||
["COLOR001", "style_01"], ["COLOR002", "style_02"], ["COLOR008", "style_08"], ["COLOR016", "style_16"],
|
||||
]);
|
||||
expect(P0A_COLOR_CARD_DEFINITIONS.map((item) => [item.cardId, item.styleId])).toEqual(
|
||||
P0A_COLOR_CARD_IDS.map((cardId, index) => [cardId, `style_${String(index + 1).padStart(2, "0")}`]),
|
||||
);
|
||||
expect(plans.map((plan) => plan.cardId)).toEqual(P0A_COLOR_CARD_IDS);
|
||||
expect(plans.every((plan) => plan.palette === plans[0]!.palette)).toBe(true);
|
||||
expect(Object.isFrozen(plans[0]!.palette)).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user