File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -51,4 +51,10 @@ describe('QueryCardHeader', () => {
51
51
52
52
expect ( screen . getByTestId ( 'execution-time-tooltip' ) ) . toHaveTextContent ( '12 345 678.91 ms' )
53
53
} )
54
+
55
+ it ( 'should render disabled copy button' , async ( ) => {
56
+ render ( < QueryCardHeader { ...instance ( mockedProps ) } emptyCommand /> )
57
+
58
+ expect ( screen . getByTestId ( 'copy-command' ) ) . toBeDisabled ( )
59
+ } )
54
60
} )
Original file line number Diff line number Diff line change @@ -257,6 +257,7 @@ const QueryCardHeader = (props: Props) => {
257
257
iconType = "copy"
258
258
aria-label = "Copy query"
259
259
className = "copy-btn"
260
+ disabled = { emptyCommand }
260
261
onClick = { ( event : React . MouseEvent ) => handleCopy ( event , query || '' ) }
261
262
data-testid = "copy-command"
262
263
/>
You can’t perform that action at this time.
0 commit comments