@@ -2,8 +2,6 @@ import { cloneDeep } from 'lodash'
2
2
import React from 'react'
3
3
import { instance , mock } from 'ts-mockito'
4
4
import { cleanup , mockedStore , render , fireEvent , act , screen , waitForEuiToolTipVisible } from 'uiSrc/utils/test-utils'
5
- import { TelemetryEvent , sendEventTelemetry } from 'uiSrc/telemetry'
6
- import { INSTANCE_ID_MOCK } from 'uiSrc/mocks/handlers/instances/instancesHandlers'
7
5
import QueryCardHeader , { Props } from './QueryCardHeader'
8
6
9
7
const mockedProps = mock < Props > ( )
@@ -30,11 +28,6 @@ jest.mock('uiSrc/slices/app/plugins', () => ({
30
28
} ) ,
31
29
} ) )
32
30
33
- jest . mock ( 'uiSrc/telemetry' , ( ) => ( {
34
- ...jest . requireActual ( 'uiSrc/telemetry' ) ,
35
- sendEventTelemetry : jest . fn ( ) ,
36
- } ) )
37
-
38
31
describe ( 'QueryCardHeader' , ( ) => {
39
32
it ( 'should render' , ( ) => {
40
33
// connectedInstanceSelector.mockImplementation(() => ({
@@ -64,25 +57,4 @@ describe('QueryCardHeader', () => {
64
57
65
58
expect ( screen . getByTestId ( 'copy-command' ) ) . toBeDisabled ( )
66
59
} )
67
-
68
- it ( 'should render disabled copy button' , async ( ) => {
69
- const command = 'info'
70
- const sendEventTelemetryMock = jest . fn ( ) ;
71
- ( sendEventTelemetry as jest . Mock ) . mockImplementation ( ( ) => sendEventTelemetryMock )
72
- render ( < QueryCardHeader { ...instance ( mockedProps ) } query = { command } /> )
73
-
74
- await act ( async ( ) => {
75
- fireEvent . click ( screen . getByTestId ( 'copy-command' ) )
76
- } )
77
-
78
- expect ( sendEventTelemetry ) . toBeCalledWith ( {
79
- event : TelemetryEvent . WORKBENCH_COMMAND_COPIED ,
80
- eventData : {
81
- command,
82
- databaseId : INSTANCE_ID_MOCK ,
83
- }
84
- } ) ;
85
-
86
- ( sendEventTelemetry as jest . Mock ) . mockRestore ( )
87
- } )
88
60
} )
0 commit comments