Skip to content

Commit a4519d1

Browse files
committed
Fixed specs for HomeTabs
1 parent 070d25b commit a4519d1

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

redisinsight/ui/src/components/home-tabs/HomeTabs.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import reactRouterDom from 'react-router-dom'
33
import { cloneDeep } from 'lodash'
44
import { render, screen, fireEvent, act, cleanup, mockedStore } from 'uiSrc/utils/test-utils'
55

6-
import { Pages } from 'uiSrc/constants'
6+
import { FeatureFlags, Pages } from 'uiSrc/constants'
77
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
88
import { appFeatureFlagsFeaturesSelector, removeFeatureFromHighlighting } from 'uiSrc/slices/app/features'
99
import HomeTabs from './HomeTabs'
@@ -18,9 +18,9 @@ beforeEach(() => {
1818
jest.mock('uiSrc/slices/app/features', () => ({
1919
...jest.requireActual('uiSrc/slices/app/features'),
2020
appFeatureFlagsFeaturesSelector: jest.fn().mockReturnValue({
21-
rdi: {
21+
redisDataIntegration: {
2222
flag: true
23-
},
23+
}
2424
}),
2525
}))
2626

@@ -88,7 +88,7 @@ describe('HomeTabs', () => {
8888

8989
fireEvent.click(screen.getByTestId('home-tab-rdi-instances'))
9090

91-
const expectedActions = [removeFeatureFromHighlighting('rdi')]
91+
const expectedActions = [removeFeatureFromHighlighting(FeatureFlags.rdi)]
9292
expect(store.getActions()).toEqual(expectedActions)
9393
})
9494

redisinsight/ui/src/components/home-tabs/HomeTabs.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState } from 'react'
22
import { EuiTab, EuiTabs } from '@elastic/eui'
33
import { useHistory, useLocation } from 'react-router-dom'
44
import { useDispatch, useSelector } from 'react-redux'
5-
import { Pages, PageValues } from 'uiSrc/constants'
5+
import { FeatureFlags, Pages, PageValues } from 'uiSrc/constants'
66
import { FeatureFlagComponent } from 'uiSrc/components'
77
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
88
import { BUILD_FEATURES } from 'uiSrc/constants/featuresHighlighting'
@@ -16,7 +16,7 @@ import styles from './styles.module.scss'
1616
const HomeTabs = () => {
1717
const [activeTab, setActiveTab] = useState('')
1818
const { features } = useSelector(appFeatureHighlightingSelector)
19-
const { rdi: rdiHighlighting } = getHighlightingFeatures(features)
19+
const { [FeatureFlags.rdi]: rdiHighlighting } = getHighlightingFeatures(features)
2020

2121
const history = useHistory()
2222
const { pathname } = useLocation()
@@ -35,7 +35,7 @@ const HomeTabs = () => {
3535
})
3636

3737
if (path === Pages.rdi) {
38-
dispatch(removeFeatureFromHighlighting('rdi'))
38+
dispatch(removeFeatureFromHighlighting(FeatureFlags.rdi))
3939
history.push(Pages.rdi)
4040
return
4141
}

redisinsight/ui/src/slices/app/features.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export const initialState: StateAppFeatures = {
4141
[FeatureFlags.hashFieldExpiration]: {
4242
flag: false
4343
},
44+
[FeatureFlags.rdi]: {
45+
flag: false
46+
}
4447
}
4548
}
4649
}

0 commit comments

Comments
 (0)