@@ -7,12 +7,13 @@ import {
7
7
} from 'uiSrc/slices/recommendations/recommendations'
8
8
import { fireEvent , screen , cleanup , mockedStore , render } from 'uiSrc/utils/test-utils'
9
9
import { MOCK_RECOMMENDATIONS } from 'uiSrc/constants/mocks/mock-recommendations'
10
- import { changeSelectedTab , insightsPanelSelector , resetExplorePanelSearch , toggleInsightsPanel } from 'uiSrc/slices/panels/insights'
10
+ import { changeSelectedTab , insightsPanelSelector , resetExplorePanelSearch , setExplorePanelIsPageOpen , toggleInsightsPanel } from 'uiSrc/slices/panels/insights'
11
11
import { sendEventTelemetry , TelemetryEvent } from 'uiSrc/telemetry'
12
12
import { Pages } from 'uiSrc/constants'
13
13
import { connectedInstanceCDSelector } from 'uiSrc/slices/instances/instances'
14
14
import { InsightsPanelTabs } from 'uiSrc/slices/interfaces/insights'
15
15
import { getTutorialCapability } from 'uiSrc/utils'
16
+ import { isShowCapabilityTutorialPopover } from 'uiSrc/services'
16
17
import DatabaseSidePanels from './DatabaseSidePanels'
17
18
18
19
let store : typeof mockedStore
@@ -78,6 +79,11 @@ jest.mock('uiSrc/utils', () => ({
78
79
getTutorialCapability : jest . fn ( ) . mockReturnValue ( { tutorialPage : { id : 'id' } , telemetryName : 'searchAndQuery' } ) ,
79
80
} ) )
80
81
82
+ jest . mock ( 'uiSrc/services' , ( ) => ( {
83
+ ...jest . requireActual ( 'uiSrc/services' ) ,
84
+ isShowCapabilityTutorialPopover : jest . fn ( ) ,
85
+ } ) )
86
+
81
87
/**
82
88
* DatabaseSidePanels tests
83
89
*
@@ -227,7 +233,8 @@ describe('DatabaseSidePanels', () => {
227
233
228
234
describe ( 'capability' , ( ) => {
229
235
beforeEach ( ( ) => {
230
- ( connectedInstanceCDSelector as jest . Mock ) . mockReturnValueOnce ( { free : true } )
236
+ ( connectedInstanceCDSelector as jest . Mock ) . mockReturnValueOnce ( { free : true } ) ;
237
+ ( isShowCapabilityTutorialPopover as jest . Mock ) . mockImplementation ( ( ) => true )
231
238
} )
232
239
it ( 'should call store actions' , ( ) => {
233
240
( getTutorialCapability as jest . Mock ) . mockImplementation ( ( ) => ( {
@@ -250,6 +257,7 @@ describe('DatabaseSidePanels', () => {
250
257
const expectedActions = [
251
258
getRecommendations ( ) ,
252
259
resetExplorePanelSearch ( ) ,
260
+ setExplorePanelIsPageOpen ( false ) ,
253
261
changeSelectedTab ( InsightsPanelTabs . Explore ) ,
254
262
toggleInsightsPanel ( true ) ,
255
263
]
0 commit comments