@@ -21,6 +21,9 @@ beforeEach(() => {
21
21
store . clearActions ( )
22
22
} )
23
23
24
+ const commandHelperId = 'command-helper'
25
+ const cliId = 'cli'
26
+
24
27
describe ( 'BottomGroupComponents' , ( ) => {
25
28
it ( 'should render' , ( ) => {
26
29
expect (
@@ -30,19 +33,19 @@ describe('BottomGroupComponents', () => {
30
33
31
34
it ( 'should render Cli when isShowCli truthy' , ( ) => {
32
35
render ( < BottomGroupComponents /> )
33
- expect ( screen . getByTestId ( 'cli' ) ) . toBeInTheDocument ( )
36
+ expect ( screen . getByTestId ( cliId ) ) . toBeInTheDocument ( )
34
37
} )
35
38
36
39
it ( 'should render Command Helper when isShowHelper truthy' , ( ) => {
37
40
render ( < BottomGroupComponents /> )
38
- expect ( screen . getByTestId ( 'command-helper' ) ) . toBeInTheDocument ( )
41
+ expect ( screen . getByTestId ( commandHelperId ) ) . toBeInTheDocument ( )
39
42
} )
40
43
41
44
it ( 'should not to close command helper after closing cli' , ( ) => {
42
45
render ( < BottomGroupComponents /> )
43
46
fireEvent . click ( screen . getByTestId ( 'collapse-cli' ) )
44
47
const expectedActions = [ toggleCli ( ) ]
45
- expect ( store . getActions ( ) ) . toEqual ( expectedActions )
48
+ expect ( store . getActions ( ) ) . toEqual ( expect . arrayContaining ( expectedActions ) )
46
49
47
50
expect ( screen . getByTestId ( 'command-helper' ) ) . toBeInTheDocument ( )
48
51
} )
@@ -52,7 +55,7 @@ describe('BottomGroupComponents', () => {
52
55
fireEvent . click ( screen . getByTestId ( 'close-command-helper' ) )
53
56
54
57
const expectedActions = [ toggleCliHelper ( ) ]
55
- expect ( store . getActions ( ) ) . toEqual ( expectedActions )
58
+ expect ( store . getActions ( ) ) . toEqual ( expect . arrayContaining ( expectedActions ) )
56
59
57
60
expect ( screen . getByTestId ( 'cli' ) ) . toBeInTheDocument ( )
58
61
} )
0 commit comments