Skip to content

Commit 3a7b436

Browse files
committed
#RI-5196 - fix tests
1 parent 2f2a799 commit 3a7b436

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

redisinsight/ui/src/components/insights-trigger/InsightsTrigger.spec.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { recommendationsSelector, resetRecommendationsHighlighting } from 'uiSrc
88
import { InsightsPanelTabs } from 'uiSrc/slices/interfaces/insights'
99
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
1010
import { Pages } from 'uiSrc/constants'
11+
import { removeFeatureFromHighlighting } from 'uiSrc/slices/app/features'
1112
import InsightsTrigger from './InsightsTrigger'
1213

1314
let store: typeof mockedStore
@@ -49,7 +50,7 @@ describe('InsightsTrigger', () => {
4950

5051
fireEvent.click(screen.getByTestId('insights-trigger'))
5152

52-
expect(store.getActions()).toEqual([toggleInsightsPanel()])
53+
expect(store.getActions()).toEqual([toggleInsightsPanel(), removeFeatureFromHighlighting('insights')])
5354
})
5455

5556
it('should call proper actions after click on the button when there are any recommendations', () => {
@@ -63,7 +64,8 @@ describe('InsightsTrigger', () => {
6364
expect(store.getActions()).toEqual([
6465
resetRecommendationsHighlighting(),
6566
changeSelectedTab(InsightsPanelTabs.Recommendations),
66-
toggleInsightsPanel()
67+
toggleInsightsPanel(),
68+
removeFeatureFromHighlighting('insights')
6769
])
6870
})
6971

@@ -89,8 +91,8 @@ describe('InsightsTrigger', () => {
8991
page: '/browser',
9092
tab: 'recommendations'
9193
},
92-
})
94+
});
9395

94-
sendEventTelemetry.mockRestore()
96+
(sendEventTelemetry as jest.Mock).mockRestore()
9597
})
9698
})

0 commit comments

Comments
 (0)