@@ -11,8 +11,7 @@ test('Review form submits', async () => {
1111 const fakeReview = {
1212 title : 'An Awesome Movie' ,
1313 review : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' ,
14- rating : '3' ,
15- recommend : true
14+ rating : '3'
1615 }
1716
1817 const {
@@ -46,7 +45,7 @@ test('Review form submits', async () => {
4645 expect ( ratingSelect . checked ) . toBe ( true )
4746 expect ( initiallySelectedInput . checked ) . toBe ( false )
4847
49- // Get the Input element by its implicit ARIA role.
48+ // Get the Input element by its implicit ARIA role
5049 const recommendInput = getByRole ( 'checkbox' )
5150
5251 expect ( recommendInput . checked ) . toBe ( false )
@@ -56,13 +55,13 @@ test('Review form submits', async () => {
5655 // NOTE: in jsdom, it's not possible to trigger a form submission
5756 // by clicking on the submit button. This is really unfortunate.
5857 // So the next best thing is to fireEvent a submit on the form itself
59- // then ensure that there's a submit button.
58+ // then ensure that there's a submit button
6059 expect ( submitButton ) . toBeEnabled ( )
6160 expect ( submitButton ) . toHaveAttribute ( 'type' , 'submit' )
6261
6362 await fireEvent . click ( submitButton )
6463
65- // Assert event has been emitted.
66- expect ( emitted ( ) . submit ) . toHaveLength ( 1 )
67- expect ( emitted ( ) . submit [ 0 ] ) . toEqual ( [ fakeReview ] )
64+ // Assert event has been emitted
65+ expect ( emitted ( ) ) . toHaveProperty ( 'submit' )
66+ expect ( emitted ( ) . submit [ 0 ] [ 0 ] ) . toMatchObject ( fakeReview )
6867} )
0 commit comments