11import { cleanup , fireEvent , render , screen } from '@testing-library/react' ;
22import Header from 'components/Header' ;
33import { AppContext } from 'context/AppContext' ;
4- import { AppAactions } from 'context/Reducer' ;
4+ import { AppActions } from 'context/Reducer' ;
55
66describe ( '<Header />' , ( ) => {
77 describe ( 'header actions' , ( ) => {
@@ -25,28 +25,28 @@ describe('<Header />', () => {
2525 fireEvent . click ( screen . getByText ( 'About' ) ) ;
2626 expect ( dispatch ) . toHaveBeenCalledWith ( {
2727 payload : 'block' ,
28- type : AppAactions . TOGGLE_ABOUT_MODAL ,
28+ type : AppActions . TOGGLE_ABOUT_MODAL ,
2929 } ) ;
3030 } ) ;
3131 it ( 'toggle the theme when toggle button is click' , ( ) => {
3232 fireEvent . click ( screen . getByTestId ( 'app-theme-button-vs-dark' ) ) ;
3333 expect ( dispatch ) . toHaveBeenCalledWith ( {
3434 payload : 'vs-dark' ,
35- type : AppAactions . TOGGLE_THEME ,
35+ type : AppActions . TOGGLE_THEME ,
3636 } ) ;
3737 } ) ;
3838
3939 it ( 'dispatch execute code action when run button is clicked' , ( ) => {
4040 fireEvent . click ( screen . getByTestId ( 'actionbutton-button-execute' ) ) ;
4141 expect ( dispatch ) . toHaveBeenCalledWith ( {
42- type : AppAactions . CODE_RUNNING ,
42+ type : AppActions . CODE_RUNNING ,
4343 } ) ;
4444 } ) ;
4545
4646 it ( 'dispatch clear result action when clear button is clicked' , ( ) => {
4747 fireEvent . click ( screen . getByTestId ( 'actionbutton-button-clear' ) ) ;
4848 expect ( dispatch ) . toHaveBeenCalledWith ( {
49- type : AppAactions . CLEAR_RESULT ,
49+ type : AppActions . CLEAR_RESULT ,
5050 } ) ;
5151 } ) ;
5252
@@ -55,7 +55,7 @@ describe('<Header />', () => {
5555 target : { value : 'Axios' } ,
5656 } ) ;
5757 expect ( dispatch ) . toHaveBeenCalledWith ( {
58- type : AppAactions . LOAD_CODE_SAMPLE ,
58+ type : AppActions . LOAD_CODE_SAMPLE ,
5959 payload : expect . objectContaining ( {
6060 codeSampleName : 'Axios' ,
6161 } ) ,
0 commit comments