File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
packages/compass-components/src/components/document-list Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments