Skip to content

Commit 3eb7310

Browse files
committed
fix and add tests
1 parent ae8e789 commit 3eb7310

File tree

3 files changed

+206
-126
lines changed

3 files changed

+206
-126
lines changed

packages/compass-data-modeling/src/components/diagram-editor-toolbar.spec.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function renderDiagramEditorToolbar(
1717
onRedoClick={() => {}}
1818
onExportClick={() => {}}
1919
onRelationshipDrawingToggle={() => {}}
20+
onAddCollectionClick={() => {}}
2021
{...props}
2122
/>
2223
);
@@ -65,6 +66,16 @@ describe('DiagramEditorToolbar', function () {
6566
});
6667
});
6768

69+
context('add collection button', function () {
70+
it('starts adding collection', function () {
71+
const addCollectionSpy = sinon.spy();
72+
renderDiagramEditorToolbar({ onAddCollectionClick: addCollectionSpy });
73+
const addButton = screen.getByRole('button', { name: 'Add Collection' });
74+
userEvent.click(addButton);
75+
expect(addCollectionSpy).to.have.been.calledOnce;
76+
});
77+
});
78+
6879
context('add relationship button', function () {
6980
it('renders it active if isInRelationshipDrawingMode is true', function () {
7081
renderDiagramEditorToolbar({ isInRelationshipDrawingMode: true });

0 commit comments

Comments
 (0)