openpencil/tests/engine/io/fig/import
rcoenen 922235d2c8
fix(kiwi): import Figma groups as groups
* fix(kiwi): import Figma groups as GROUP nodes instead of FRAME

- Map FRAME nodes with `resizeToFit === true` to `GROUP` type on import
- Write `resizeToFit = true` when exporting `GROUP` nodes back to Kiwi format
- Document findings and diagnosis in packages/docs/development/group-to-frame-import-issue.md
- Extract resolveNodeType helper to satisfy cyclomatic complexity limits

* test(kiwi): harden Figma group import + add coverage

Follow-up hardening on the group import/export fix:

- convert.ts: reorder so the COMPONENT_SET check runs before the FRAME→GROUP
  reclassification, and guard the group check on the absence of auto-layout
  (`stackMode` unset/NONE). Figma auto-layout "hug" frames use
  stackPrimarySizing/stackCounterSizing, not `resizeToFit`, so this prevents a
  component-set or auto-layout frame that happens to carry `resizeToFit` from being
  misclassified as a group.

- Add tests/engine/io/fig/import/group-reclassify.test.ts: unit coverage for the
  reclassification (FRAME+resizeToFit → GROUP, plain frame stays FRAME, auto-layout
  hug frame stays FRAME), plus a real-file assertion that gold-preview.fig imports
  its groups as GROUP.

- Add tests/engine/io/fig/roundtrip/group.test.ts: a created GROUP survives
  export → re-import as a GROUP (validates the export-side resizeToFit write).

- Update exhaustive.test.ts gold-preview golden: 519 nodes that were misimported as
  FRAME are now correctly GROUP (FRAME 4525→4006, GROUP 519), and export size shifts
  594758→594770 because exported groups now carry resizeToFit.

Note: the pre-existing material3 variables roundtrip failure
("Invalid value EXCLUDE for enum BooleanOperation") is unrelated to groups and
also fails on master — out of scope here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* chore(kiwi): remove temporary group-to-frame analysis doc

It was a scratch diagnostic artifact (and contained a hardcoded local path);
the rationale now lives in the fix's commit messages, code comments, and tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Danila Poyarkov <dev@dannote.net>
2026-06-06 13:49:19 +03:00
..
legacy fix(kiwi): preserve imported boolean geometry 2026-05-31 13:28:41 +03:00
basic.test.ts test(engine): align io tests with source tree 2026-05-16 11:59:02 +03:00
boolean-operation.test.ts fix(kiwi): preserve imported boolean geometry 2026-05-31 13:28:41 +03:00
component-props.test.ts chore: format codebase 2026-05-24 12:15:29 +03:00
derived-symbol-data.test.ts chore: format codebase 2026-05-24 12:15:29 +03:00
edge-cases.test.ts test(engine): align io tests with source tree 2026-05-16 11:59:02 +03:00
field-protection.test.ts refactor(kiwi): group fig format internals 2026-05-21 14:54:13 +03:00
font-variations.test.ts fix(core): address compatibility review findings 2026-05-28 09:57:46 +03:00
group-reclassify.test.ts fix(kiwi): import Figma groups as groups 2026-06-06 13:49:19 +03:00
instance-regressions.test.ts fix(fig): restore lazy badge visibility overrides 2026-05-21 14:54:18 +03:00
lazy-pages.test.ts fix(fig): populate lazy pages before export 2026-05-19 21:01:17 +03:00
mask-oracle.test.ts fix(canvas): tighten Figma text and pattern fidelity 2026-05-26 18:30:08 +03:00
masks.test.ts fix(kiwi): preserve mask outline metadata 2026-05-26 15:44:35 +03:00
paint-schema-fields.test.ts fix(canvas): tighten Figma text and pattern fidelity 2026-05-26 18:30:08 +03:00
pattern-paint-oracle.test.ts test(canvas): summarize pattern oracle deltas 2026-05-27 14:25:10 +03:00
property-integrity.test.ts test(engine): align io tests with source tree 2026-05-16 11:59:02 +03:00
raw-field-coverage.test.ts fix(canvas): support stretched layout grids 2026-05-28 05:39:40 +03:00
raw-metadata-oracle.test.ts fix(canvas): render imported page guides 2026-05-27 19:00:23 +03:00
rich-text-oracle.test.ts fix(canvas): tighten Figma text and pattern fidelity 2026-05-26 18:30:08 +03:00
scaled-instance-strokes.test.ts chore: format codebase 2026-05-24 12:15:29 +03:00
schema-coverage.test.ts docs(cli): use released openpencil command 2026-05-29 15:56:52 +03:00
style-refs.test.ts chore: format codebase 2026-05-24 12:15:29 +03:00