Skip to content

Commit 15c7c43

Browse files
#RI-3699-add tooltip tests
1 parent 16fc15c commit 15c7c43

File tree

1 file changed

+20
-2
lines changed
  • redisinsight/ui/src/pages/databaseAnalysis/components/header

1 file changed

+20
-2
lines changed

redisinsight/ui/src/pages/databaseAnalysis/components/header/Header.spec.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ describe('DatabaseAnalysisHeader', () => {
132132
})
133133
})
134134

135-
describe('Cluster tooltip', () => {
135+
describe('CLUSTER db', () => {
136136
beforeEach(() => {
137137
const state: any = store.getState()
138138
connectType(state, 'CLUSTER')
@@ -150,7 +150,7 @@ describe('Cluster tooltip', () => {
150150
})
151151
})
152152

153-
describe('Default tooltip', () => {
153+
describe('STANDALONE db', () => {
154154
beforeEach(() => {
155155
const state: any = store.getState()
156156
connectType(state, 'STANDALONE')
@@ -167,3 +167,21 @@ describe('Default tooltip', () => {
167167
expect(screen.getByTestId('db-new-reports-tooltip')).toHaveTextContent('Redis Database AnalysisAnalyze up to 10 000 keys per Redis database to get an overview of your data.')
168168
})
169169
})
170+
171+
describe('SENTINEL db', () => {
172+
beforeEach(() => {
173+
const state: any = store.getState()
174+
connectType(state, 'SENTINEL')
175+
})
176+
177+
it('should render default tooltip message', async () => {
178+
render(<Header {...instance(mockedProps)} />)
179+
180+
await act(async () => {
181+
fireEvent.mouseOver(screen.getByTestId('db-new-reports-icon'))
182+
})
183+
await waitForEuiToolTipVisible()
184+
185+
expect(screen.getByTestId('db-new-reports-tooltip')).toHaveTextContent('Redis Database AnalysisAnalyze up to 10 000 keys per Redis database to get an overview of your data.')
186+
})
187+
})

0 commit comments

Comments
 (0)