Skip to content

Commit f3ac103

Browse files
committed
unit test
1 parent 78625e1 commit f3ac103

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function renderDiagramEditorToolbar(
1212
step="EDITING"
1313
hasUndo={true}
1414
hasRedo={true}
15+
onDownloadClick={() => {}}
1516
onUndoClick={() => {}}
1617
onRedoClick={() => {}}
1718
onExportClick={() => {}}
@@ -63,12 +64,21 @@ describe('DiagramEditorToolbar', function () {
6364
});
6465
});
6566

66-
it('renders export buttona and calls onExportClick', function () {
67+
it('renders export button and calls onExportClick', function () {
6768
const exportSpy = sinon.spy();
6869
renderDiagramEditorToolbar({ onExportClick: exportSpy });
6970
const exportButton = screen.getByRole('button', { name: 'Export' });
7071
expect(exportButton).to.exist;
7172
userEvent.click(exportButton);
7273
expect(exportSpy).to.have.been.calledOnce;
7374
});
75+
76+
it('renders download button and calls onDownloadClick', function () {
77+
const downloadSpy = sinon.spy();
78+
renderDiagramEditorToolbar({ onDownloadClick: downloadSpy });
79+
const downloadButton = screen.getByRole('button', { name: 'Download' });
80+
expect(downloadButton).to.exist;
81+
userEvent.click(downloadButton);
82+
expect(downloadSpy).to.have.been.calledOnce;
83+
});
7484
});

0 commit comments

Comments
 (0)