@@ -52,14 +52,13 @@ describe('Unit testing for ButtonContainer', () => {
5252 } ) ;
5353
5454 describe ( 'When button container is loaded' , ( ) => {
55- test ( 'should have 5 buttons ' , ( ) => {
55+ test ( 'should have 4 buttons ' , ( ) => {
5656 render ( < ButtonsContainer /> ) ;
57- expect ( screen . getAllByRole ( 'button' ) ) . toHaveLength ( 5 ) ;
57+ expect ( screen . getAllByRole ( 'button' ) ) . toHaveLength ( 4 ) ;
5858 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' ) ;
6362 } ) ;
6463 } ) ;
6564
@@ -74,10 +73,10 @@ describe('Unit testing for ButtonContainer', () => {
7473 describe ( 'Upload/Download' , ( ) => {
7574 test ( 'Clicking upload and download buttons' , async ( ) => {
7675 render ( < ButtonsContainer /> ) ;
76+ fireEvent . click ( screen . getAllByRole ( 'button' ) [ 1 ] ) ;
7777 fireEvent . click ( screen . getAllByRole ( 'button' ) [ 2 ] ) ;
78- fireEvent . click ( screen . getAllByRole ( 'button' ) [ 3 ] ) ;
78+ expect ( screen . getAllByRole ( 'button' ) [ 1 ] ) . toBeInTheDocument ( ) ;
7979 expect ( screen . getAllByRole ( 'button' ) [ 2 ] ) . toBeInTheDocument ( ) ;
80- expect ( screen . getAllByRole ( 'button' ) [ 3 ] ) . toBeInTheDocument ( ) ;
8180 } ) ;
8281 } ) ;
8382} ) ;
0 commit comments