From 82eec28b3f882adad0edf464c9bbc3a8bcb970e1 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Wed, 27 May 2026 10:53:13 +0300 Subject: [PATCH] test(kiwi): cover raw effect invalidation --- .../io/fig/roundtrip/source-metadata.test.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/engine/io/fig/roundtrip/source-metadata.test.ts b/tests/engine/io/fig/roundtrip/source-metadata.test.ts index 182658231..678baa2ed 100644 --- a/tests/engine/io/fig/roundtrip/source-metadata.test.ts +++ b/tests/engine/io/fig/roundtrip/source-metadata.test.ts @@ -221,6 +221,42 @@ describe('fig roundtrip source metadata', () => { expect(exported?.effects?.[0]?.density).toBeCloseTo(0.4) }) + test('clears raw unsupported effects when normalized effects are edited', () => { + const graph = new SceneGraph() + const page = graph.getPages()[0] + const rect = graph.createNode('RECTANGLE', page.id, { name: 'Edited effect metadata' }) + rect.source.format = 'fig' + rect.source.id = '4:504' + rect.source.fig.rawNodeFields.effects = [ + { + type: 'NOISE', + visible: true, + offset: { x: 0, y: 0 }, + radius: 0, + spread: 0, + noiseSize: { x: 0.5, y: 0.5 }, + noiseType: 'MONOTONE', + color: { r: 0, g: 0, b: 0, a: 1 }, + density: 0.4 + } + ] + + graph.updateNode(rect.id, { + effects: [ + { + type: 'DROP_SHADOW', + color: { r: 0, g: 0, b: 0, a: 0.2 }, + offset: { x: 0, y: 4 }, + radius: 8, + spread: 0, + visible: true + } + ] + }) + + expect(rect.source.fig.rawNodeFields.effects).toBeUndefined() + }) + test('clears raw font variation payloads when normalized axes are edited', async () => { const graph = new SceneGraph() const page = graph.getPages()[0]