Skip to content

AI-native design editor. Open-source Figma alternative.

test(ui): cover boolean outline menu placement

Danila Poyarkov655f4fcb89af
diff --git a/src/components/properties/BooleanOperationsControl.vue b/src/components/properties/BooleanOperationsControl.vue
index d578e7f98..df0c65b9c 100644
--- a/src/components/properties/BooleanOperationsControl.vue
+++ b/src/components/properties/BooleanOperationsControl.vue
@@ -50,6 +50,7 @@ const itemCls = menuItem({ justify: 'between' })
<DropdownMenuItem
v-for="operation in operations"
:key="operation.id"
+ :data-test-id="`boolean-operation-${operation.id.replace('selection.', '')}`"
:class="itemCls"
:disabled="!getCommand(operation.id).enabled.value"
@select="runCommand(operation.id)"
diff --git a/tests/e2e/context-menu/basic.spec.ts b/tests/e2e/context-menu/basic.spec.ts
index 35131dce6..c6f1338d3 100644
--- a/tests/e2e/context-menu/basic.spec.ts
+++ b/tests/e2e/context-menu/basic.spec.ts
@@ -65,6 +65,10 @@ test('draw shape and right-click selects it', async () => {
})
test('context menu shows expected items', async () => {
+ await editor.canvas.drawRect(200, 200, 120, 80)
+ await editor.canvas.waitForRender()
+ await rightClickShape(250, 230)
+
await expect(contextItem('context-copy')).toBeVisible()
await expect(contextItem('context-cut')).toBeVisible()
await expect(contextItem('context-duplicate')).toBeVisible()
@@ -74,6 +78,9 @@ test('context menu shows expected items', async () => {
await expect(contextItem('context-send-to-back')).toBeVisible()
await expect(contextItem('context-toggle-visibility')).toBeVisible()
await expect(contextItem('context-toggle-lock')).toBeVisible()
+ await expect(contextItem('context-flatten')).toBeVisible()
+ await expect(contextItem('context-outline-text')).toBeVisible()
+ await expect(contextItem('context-boolean-union')).toHaveCount(0)
await editor.page.keyboard.press('Escape')
})
diff --git a/tests/e2e/design/panel.spec.ts b/tests/e2e/design/panel.spec.ts
index aab7da392..6fa7c4167 100644
--- a/tests/e2e/design/panel.spec.ts
+++ b/tests/e2e/design/panel.spec.ts
@@ -294,7 +294,7 @@ test('deselecting shows empty design panel', async () => {
await expect(editor.page.getByTestId('design-panel-empty')).toBeVisible()
})
-test('multi-select shows mixed header', async () => {
+test('multi-select shows mixed header and boolean operations', async () => {
await editor.canvas.drawRect(300, 100, 60, 60)
await editor.canvas.drawRect(400, 100, 60, 60)
await editor.canvas.selectAll()
@@ -304,4 +304,11 @@ test('multi-select shows mixed header', async () => {
await expect(multiHeader).toBeVisible()
await expect(multiHeader).toContainText('Mixed')
await expect(multiHeader).toContainText('layers')
+
+ await editor.page.getByTestId('boolean-operations-trigger').click()
+ await expect(editor.page.getByTestId('boolean-operation-booleanUnion')).toBeVisible()
+ await expect(editor.page.getByTestId('boolean-operation-booleanSubtract')).toBeVisible()
+ await expect(editor.page.getByTestId('boolean-operation-booleanIntersect')).toBeVisible()
+ await expect(editor.page.getByTestId('boolean-operation-booleanExclude')).toBeVisible()
+ await expect(editor.page.getByTestId('boolean-operation-flatten')).toBeVisible()
})