Skip to content

Commit a374a6b

Browse files
author
Roman.Sergeenko
committed
#RI-1756 - fix tests
1 parent 973ef61 commit a374a6b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

redisinsight/ui/src/components/bottom-group-components/BottomGroupComponents.spec.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ beforeEach(() => {
2121
store.clearActions()
2222
})
2323

24+
const commandHelperId = 'command-helper'
25+
const cliId = 'cli'
26+
2427
describe('BottomGroupComponents', () => {
2528
it('should render', () => {
2629
expect(
@@ -30,19 +33,19 @@ describe('BottomGroupComponents', () => {
3033

3134
it('should render Cli when isShowCli truthy', () => {
3235
render(<BottomGroupComponents />)
33-
expect(screen.getByTestId('cli')).toBeInTheDocument()
36+
expect(screen.getByTestId(cliId)).toBeInTheDocument()
3437
})
3538

3639
it('should render Command Helper when isShowHelper truthy', () => {
3740
render(<BottomGroupComponents />)
38-
expect(screen.getByTestId('command-helper')).toBeInTheDocument()
41+
expect(screen.getByTestId(commandHelperId)).toBeInTheDocument()
3942
})
4043

4144
it('should not to close command helper after closing cli', () => {
4245
render(<BottomGroupComponents />)
4346
fireEvent.click(screen.getByTestId('collapse-cli'))
4447
const expectedActions = [toggleCli()]
45-
expect(store.getActions()).toEqual(expectedActions)
48+
expect(store.getActions()).toEqual(expect.arrayContaining(expectedActions))
4649

4750
expect(screen.getByTestId('command-helper')).toBeInTheDocument()
4851
})
@@ -52,7 +55,7 @@ describe('BottomGroupComponents', () => {
5255
fireEvent.click(screen.getByTestId('close-command-helper'))
5356

5457
const expectedActions = [toggleCliHelper()]
55-
expect(store.getActions()).toEqual(expectedActions)
58+
expect(store.getActions()).toEqual(expect.arrayContaining(expectedActions))
5659

5760
expect(screen.getByTestId('cli')).toBeInTheDocument()
5861
})

0 commit comments

Comments
 (0)