@@ -52,14 +52,13 @@ describe('Unit testing for ButtonContainer', () => {
52
52
} ) ;
53
53
54
54
describe ( 'When button container is loaded' , ( ) => {
55
- test ( 'should have 5 buttons ' , ( ) => {
55
+ test ( 'should have 4 buttons ' , ( ) => {
56
56
render ( < ButtonsContainer /> ) ;
57
- expect ( screen . getAllByRole ( 'button' ) ) . toHaveLength ( 5 ) ;
57
+ expect ( screen . getAllByRole ( 'button' ) ) . toHaveLength ( 4 ) ;
58
58
expect ( screen . getAllByRole ( 'button' ) [ 0 ] ) . toHaveTextContent ( 'Lock' ) ;
59
- expect ( screen . getAllByRole ( 'button' ) [ 1 ] ) . toHaveTextContent ( 'Split' ) ;
60
- expect ( screen . getAllByRole ( 'button' ) [ 2 ] ) . toHaveTextContent ( 'Download' ) ;
61
- expect ( screen . getAllByRole ( 'button' ) [ 3 ] ) . toHaveTextContent ( 'Upload' ) ;
62
- expect ( screen . getAllByRole ( 'button' ) [ 4 ] ) . toHaveTextContent ( 'How to use' ) ;
59
+ expect ( screen . getAllByRole ( 'button' ) [ 1 ] ) . toHaveTextContent ( 'Download' ) ;
60
+ expect ( screen . getAllByRole ( 'button' ) [ 2 ] ) . toHaveTextContent ( 'Upload' ) ;
61
+ expect ( screen . getAllByRole ( 'button' ) [ 3 ] ) . toHaveTextContent ( 'How to use' ) ;
63
62
} ) ;
64
63
} ) ;
65
64
@@ -74,10 +73,10 @@ describe('Unit testing for ButtonContainer', () => {
74
73
describe ( 'Upload/Download' , ( ) => {
75
74
test ( 'Clicking upload and download buttons' , async ( ) => {
76
75
render ( < ButtonsContainer /> ) ;
76
+ fireEvent . click ( screen . getAllByRole ( 'button' ) [ 1 ] ) ;
77
77
fireEvent . click ( screen . getAllByRole ( 'button' ) [ 2 ] ) ;
78
- fireEvent . click ( screen . getAllByRole ( 'button' ) [ 3 ] ) ;
78
+ expect ( screen . getAllByRole ( 'button' ) [ 1 ] ) . toBeInTheDocument ( ) ;
79
79
expect ( screen . getAllByRole ( 'button' ) [ 2 ] ) . toBeInTheDocument ( ) ;
80
- expect ( screen . getAllByRole ( 'button' ) [ 3 ] ) . toBeInTheDocument ( ) ;
81
80
} ) ;
82
81
} ) ;
83
82
} ) ;
0 commit comments