Skip to content

Commit 9c6bb47

Browse files
committed
fix: hide Add to query hiding test
1 parent cc2aed6 commit 9c6bb47

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/compass-components/src/components/document-list/element.spec.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,22 @@ describe('HadronElement', function () {
122122
expect(screen.queryByText('Open URL in browser')).to.not.exist;
123123
});
124124

125+
it('does not show "Add to query" when onAddToQuery is not provided', function () {
126+
render(
127+
<HadronElement
128+
value={element}
129+
editable={true}
130+
editingEnabled={true}
131+
lineNumberSize={1}
132+
onAddElement={() => {}}
133+
/>
134+
);
135+
const elementNode = screen.getByTestId('hadron-document-element');
136+
userEvent.click(elementNode, { button: 2 });
137+
138+
expect(screen.queryByText('Add to query')).to.not.exist;
139+
});
140+
125141
it('calls the correct parameters when "Add to query" is clicked', function () {
126142
const onAddToQuerySpy = sinon.spy();
127143

0 commit comments

Comments
 (0)