Skip to content

Commit cf8a623

Browse files
committed
chore(data-modeling): fix tests
1 parent c6e540e commit cf8a623

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ describe('DiagramEditorSidePanel', function () {
5353

5454
it('should not render if no items are selected', function () {
5555
renderDrawer();
56+
expect(screen.queryByTestId('data-modeling-drawer')).to.eq(null);
5657
});
5758

5859
it('should render a collection context drawer when collection is clicked', async function () {
@@ -93,8 +94,6 @@ describe('DiagramEditorSidePanel', function () {
9394
await comboboxSelectItem('Foreign collection', 'countries');
9495
await comboboxSelectItem('Foreign field', 'iso_code');
9596

96-
userEvent.click(screen.getByRole('button', { name: 'Save' }));
97-
9897
// We should be testing through rendered UI but as it's really hard to make
9998
// diagram rendering in tests property, we are just validating the final
10099
// model here
@@ -118,9 +117,5 @@ describe('DiagramEditorSidePanel', function () {
118117
cardinality: 1,
119118
},
120119
]);
121-
122-
// After saving when starting from collection, we should end up back in the
123-
// collection drawer that we started from
124-
expect(screen.getByText('flights.countries')).to.be.visible;
125120
});
126121
});

packages/compass-data-modeling/src/components/diagram-editor-side-panel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ function DiagmramEditorSidePanel({
5454
}
5555

5656
return (
57-
<div className={cx(containerStyles, isDarkMode && darkModeContainerStyles)}>
57+
<div
58+
className={cx(containerStyles, isDarkMode && darkModeContainerStyles)}
59+
data-testid="data-modeling-drawer"
60+
>
5861
{content}
5962
<Button onClick={onClose} variant="primary" size="small">
6063
Close Side Panel

0 commit comments

Comments
 (0)