Skip to content

Commit

Permalink
Use toHaveBeenCalledWith.
Browse files Browse the repository at this point in the history
  • Loading branch information
BE-Webdesign committed Dec 14, 2017
1 parent 4793466 commit 41741a3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions editor/test/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,10 @@ describe( 'effects', () => {
};

expect( dispatch ).toHaveBeenCalledTimes( 4 );
expect( dispatch.mock.calls[ 0 ][ 0 ] ).toEqual( updatePost );
expect( dispatch.mock.calls[ 1 ][ 0 ] ).toEqual( removeNotice );
expect( dispatch.mock.calls[ 2 ][ 0 ] ).toEqual( resetPostAction );
expect( dispatch.mock.calls[ 3 ][ 0 ] ).toEqual( requestPostUpdateSuccess );
expect( dispatch ).toHaveBeenCalledWith( updatePost );
expect( dispatch ).toHaveBeenCalledWith( removeNotice );
expect( dispatch ).toHaveBeenCalledWith( resetPostAction );
expect( dispatch ).toHaveBeenCalledWith( requestPostUpdateSuccess );
} );

it( 'should dispatch three actions on failure post.', () => {
Expand Down Expand Up @@ -486,9 +486,9 @@ describe( 'effects', () => {
};

expect( dispatch ).toHaveBeenCalledTimes( 3 );
expect( dispatch.mock.calls[ 0 ][ 0 ] ).toEqual( updatePost );
expect( dispatch.mock.calls[ 1 ][ 0 ] ).toEqual( removeNotice );
expect( dispatch.mock.calls[ 2 ][ 0 ] ).toEqual( requestPostFailure );
expect( dispatch ).toHaveBeenCalledWith( updatePost );
expect( dispatch ).toHaveBeenCalledWith( removeNotice );
expect( dispatch ).toHaveBeenCalledWith( requestPostFailure );
} );
} );

Expand Down

0 comments on commit 41741a3

Please sign in to comment.