From 1b1c7e6409f9d3be0c1fe6e3dcd582478cc80fd6 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Sun, 17 May 2026 20:01:37 +0300 Subject: [PATCH] test(text): lock complex outline guards --- tests/engine/editor/structure/boolean.test.ts | 16 ++++++++++++++ tests/engine/editor/structure/flatten.test.ts | 21 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/tests/engine/editor/structure/boolean.test.ts b/tests/engine/editor/structure/boolean.test.ts index 075323bb3..77f6f50e0 100644 --- a/tests/engine/editor/structure/boolean.test.ts +++ b/tests/engine/editor/structure/boolean.test.ts @@ -37,6 +37,22 @@ describe('booleanOperationSelected', () => { expect(editor.state.selectedIds).toEqual(new Set([first.id, second.id])) }) + test('does not wrap complex script text without shaping support', () => { + const editor = createEditor() + const pageId = editor.state.currentPageId + const first = editor.graph.createNode('TEXT', pageId, { + text: 'مرحبا', + fontFamily: 'Inter' + }) + const second = editor.graph.createNode('RECTANGLE', pageId) + + editor.select([first.id, second.id]) + const result = editor.booleanOperationSelected('UNION') + + expect(result).toBeNull() + expect(editor.graph.getNode(pageId)?.childIds).toEqual([first.id, second.id]) + }) + test('does not wrap visible image fills', () => { const editor = createEditor() const pageId = editor.state.currentPageId diff --git a/tests/engine/editor/structure/flatten.test.ts b/tests/engine/editor/structure/flatten.test.ts index 6882e44f1..ac617785c 100644 --- a/tests/engine/editor/structure/flatten.test.ts +++ b/tests/engine/editor/structure/flatten.test.ts @@ -153,6 +153,27 @@ describe('flattenSelected', () => { surface.delete() }) + test('does not flatten complex script text without shaping support', async () => { + await loadInterRegular() + const { editor, surface } = await createEditorWithRenderer() + const pageId = editor.state.currentPageId + const text = editor.graph.createNode('TEXT', pageId, { + text: 'مرحبا', + fontFamily: 'Inter', + fontWeight: 400, + fontSize: 32, + width: 120, + height: 40 + }) + + editor.select([text.id]) + const result = editor.flattenSelected() + + expect(result).toBeNull() + expect(editor.graph.getNode(text.id)?.type).toBe('TEXT') + surface.delete() + }) + test('does not flatten unsupported text nodes', async () => { const { editor, surface } = await createEditorWithRenderer() const pageId = editor.state.currentPageId