diff --git a/packages/editor-ui/src/components/canvas/Canvas.vue b/packages/editor-ui/src/components/canvas/Canvas.vue index b72c8065f4ab1..84997b70f62fa 100644 --- a/packages/editor-ui/src/components/canvas/Canvas.vue +++ b/packages/editor-ui/src/components/canvas/Canvas.vue @@ -1,13 +1,13 @@ diff --git a/packages/editor-ui/src/components/canvas/elements/edges/CanvasEdgeToolbar.spec.ts b/packages/editor-ui/src/components/canvas/elements/edges/CanvasEdgeToolbar.spec.ts new file mode 100644 index 0000000000000..6968ac58a4a47 --- /dev/null +++ b/packages/editor-ui/src/components/canvas/elements/edges/CanvasEdgeToolbar.spec.ts @@ -0,0 +1,16 @@ +import { fireEvent } from '@testing-library/vue'; +import CanvasEdgeToolbar from './CanvasEdgeToolbar.vue'; +import { createComponentRenderer } from '@/__tests__/render'; + +const renderComponent = createComponentRenderer(CanvasEdgeToolbar); + +describe('CanvasEdgeToolbar', () => { + it('should emit delete event when delete button is clicked', async () => { + const { getByTestId, emitted } = renderComponent(); + const deleteButton = getByTestId('delete-connection-button'); + + await fireEvent.click(deleteButton); + + expect(emitted()).toHaveProperty('delete'); + }); +}); diff --git a/packages/editor-ui/src/components/canvas/elements/edges/CanvasEdgeToolbar.vue b/packages/editor-ui/src/components/canvas/elements/edges/CanvasEdgeToolbar.vue new file mode 100644 index 0000000000000..c7d287aa4b86d --- /dev/null +++ b/packages/editor-ui/src/components/canvas/elements/edges/CanvasEdgeToolbar.vue @@ -0,0 +1,42 @@ + + + + +