Skip to content

Commit 3df807f

Browse files
committed
cleanup and update selector
1 parent 346d0d0 commit 3df807f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/compass-components/src/components/drawer-portal.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ describe('DrawerSection', function () {
215215
expect(screen.getByTestId('drawer-state')).to.have.text('closed');
216216

217217
// Open the drawer
218-
userEvent.click(screen.getByTestId('toggle-drawer'));
218+
userEvent.click(screen.getByRole('button', { name: 'Open drawer' }));
219219
await waitFor(() => {
220220
expect(screen.getByTestId('drawer-state')).to.have.text('open');
221221
expect(screen.getByText('This is the controlled section')).to.be.visible;
222222
});
223223

224224
// Close the drawer
225-
userEvent.click(screen.getByTestId('toggle-drawer'));
225+
userEvent.click(screen.getByRole('button', { name: 'Close drawer' }));
226226
await waitFor(() => {
227227
expect(screen.getByTestId('drawer-state')).to.have.text('closed');
228228
expect(screen.queryByText('This is the controlled section')).not.to.exist;

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,11 @@ export default connect(
144144
const model = selectCurrentModelFromState(state);
145145

146146
if (selected.type === 'collection') {
147-
const isNewCollection = !selected.id;
148147
const doesCollectionExist = model.collections.find((collection) => {
149148
return collection.ns === selected.id;
150149
});
151150

152-
if (!isNewCollection && !doesCollectionExist) {
151+
if (!doesCollectionExist) {
153152
// TODO(COMPASS-9680): When the selected collection doesn't exist then we
154153
// don't show any selection. We can get into this state with undo/redo.
155154
return {
@@ -160,7 +159,7 @@ export default connect(
160159
return {
161160
selectedItems: {
162161
...selected,
163-
label: selected.id || 'New Collection',
162+
label: selected.id,
164163
},
165164
};
166165
}

0 commit comments

Comments
 (0)