test(text): lock complex outline guards
This commit is contained in:
parent
75c2975fdc
commit
1b1c7e6409
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue