@@ -15,7 +15,6 @@ const state = {
1515 currentTab : 87 ,
1616} ;
1717
18- const play = jest . fn ( ) ;
1918const dispatch = jest . fn ( ) ;
2019
2120jest . mock ( '../store' ) ;
@@ -48,6 +47,7 @@ describe('All elements appear in the TravelContainer module', () => {
4847 test ( 'MainSlider exists in document' , ( ) => {
4948 expect ( screen . getByText ( 'MockSlider' ) ) . toBeInTheDocument ( ) ;
5049 } ) ;
50+
5151 test ( 'Dropdown exists in document' , ( ) => {
5252 expect ( screen . getByText ( 'mockDropDown' ) ) . toBeInTheDocument ( ) ;
5353 } ) ;
@@ -57,7 +57,7 @@ describe('All elements appear in the TravelContainer module', () => {
5757 expect ( buttons [ 1 ] ) . toHaveTextContent ( '<' ) ;
5858 } ) ;
5959
60- test ( 'Foward button exists in document' , ( ) => {
60+ test ( 'Forward button exists in document' , ( ) => {
6161 let buttons = screen . getAllByRole ( 'button' ) ;
6262 expect ( buttons [ 2 ] ) . toHaveTextContent ( '>' ) ;
6363 } ) ;
@@ -69,18 +69,18 @@ describe('Testing backward and forward button', () => {
6969 render ( < TravelContainer snapshotsLength = { 0 } /> ) ;
7070 } ) ;
7171
72- test ( 'Clicking < Button button will triger button' , async ( ) => {
72+ test ( 'Clicking < Button button will trigger button' , ( ) => {
7373 let buttons = screen . getAllByRole ( 'button' ) ;
7474 expect ( buttons [ 1 ] ) . toHaveTextContent ( '<' ) ;
7575 fireEvent . click ( buttons [ 1 ] ) ;
76- await expect ( dispatch ) . toHaveBeenCalledTimes ( 1 ) ;
76+ expect ( dispatch ) . toHaveBeenCalledTimes ( 1 ) ;
7777 } ) ;
7878
79- test ( 'Clicking > Button button will triger button' , async ( ) => {
79+ test ( 'Clicking > Button button will trigger button' , ( ) => {
8080 let buttons = screen . getAllByRole ( 'button' ) ;
8181 expect ( buttons [ 2 ] ) . toHaveTextContent ( '>' ) ;
8282 fireEvent . click ( buttons [ 2 ] ) ;
83- await expect ( dispatch ) . toHaveBeenCalledTimes ( 1 ) ;
83+ expect ( dispatch ) . toHaveBeenCalledTimes ( 1 ) ;
8484 } ) ;
8585} ) ;
8686
@@ -94,33 +94,34 @@ describe('Testing play/pause button', () => {
9494 const playButton = screen . getByTestId ( 'play-button-test' ) ;
9595 expect ( playButton ) . toBeInTheDocument ( ) ;
9696 } ) ;
97+
9798 test ( 'Play initially says Play' , ( ) => {
9899 render ( < TravelContainer snapshotsLength = { 0 } /> ) ;
99100 const playButton = screen . getByTestId ( 'play-button-test' ) ;
100101 expect ( playButton . textContent ) . toBe ( 'Play' ) ;
101102 } ) ;
102103
103- test ( 'Clicking Play button will triger button' , async ( ) => {
104+ test ( 'Clicking Play button will trigger button' , ( ) => {
104105 render ( < TravelContainer snapshotsLength = { 0 } /> ) ;
105106 const playButton = screen . getByTestId ( 'play-button-test' ) ;
106107 expect ( playButton . textContent ) . toBe ( 'Play' ) ;
107108 fireEvent . click ( playButton ) ;
108- await expect ( dispatch ) . toHaveBeenCalledTimes ( 1 ) ;
109+ expect ( dispatch ) . toHaveBeenCalledTimes ( 1 ) ;
109110 } ) ;
110111
111- test ( 'Play says Pause when `Playing` is set to False ' , ( ) => {
112+ test ( 'Play says Pause when `Playing` is set to true ' , ( ) => {
112113 state . tabs [ 87 ] . playing = true ;
113114 render ( < TravelContainer snapshotsLength = { 0 } /> ) ;
114115 const playButton = screen . getByTestId ( 'play-button-test' ) ;
115116 expect ( playButton . textContent ) . toBe ( 'Pause' ) ;
116117 } ) ;
117118
118- test ( 'Clicking Pause button will trigger button' , async ( ) => {
119+ test ( 'Clicking Pause button will trigger button' , ( ) => {
119120 render ( < TravelContainer snapshotsLength = { 0 } /> ) ;
120121 const playButton = screen . getByTestId ( 'play-button-test' ) ;
121122 expect ( playButton . textContent ) . toBe ( 'Pause' ) ;
122123 fireEvent . click ( playButton ) ;
123- await expect ( dispatch ) . toHaveBeenCalledTimes ( 1 ) ;
124+ expect ( dispatch ) . toHaveBeenCalledTimes ( 1 ) ;
124125 state . tabs [ 87 ] . playing = false ;
125126 } ) ;
126127} ) ;
0 commit comments