AI Code2Des — Test Cases
| Area | Assertion |
|---|---|
| Message | Reject missing/unknown fields, invalid IDs/hash/URL, or attempt other than 1 |
| Capture pin | Reject byte-hash or tenant/Page Import identity mismatch |
| Frames | Preserve hierarchy, bbox, paint order, clipping, borders, radii, shadows, gradients, and blend mode |
| Text | Preserve single-line width behavior, wrapping bbox, typography, alignment, decoration, and opacity |
| Images | Preserve asset identity, object fit, saturation/grayscale adjustment, and hydrated bytes |
| SVG | Preserve supported SVG as vector; use rasterized capture evidence for unsupported background SVG |
| Unsupported | Emit warning/unmatched node without aborting unrelated siblings |
| Artifact | Write immutable result before manifest and report the exact warning count |
| Failure | Write safe failure artifact/manifest and failed webhook |
| Plugin | Create native nodes, retain old generations, report actual successful layer count, and record latest root ID |
| Backend | Page Import completion never creates Code2Des; trigger requires a completed scoped import; each trigger creates a distinct row; enqueue failure affects only that Code2Des row |
Project-agnostic visual acceptance compares source screenshot and generated Figma output across multiple unrelated sites. It must inspect geometry, stacking, background/vector layers, typography/wrapping, gradients, clipping, image color, and missing/degraded nodes—not only whether generation completed.