Skip to content

Commit

Permalink
fixes test after reming superfluous actions from deleteEntityRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Jun 11, 2020
1 parent 7d9afbf commit 3b74e9e
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions packages/core-data/src/test/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,19 @@ describe( 'deleteEntityRecord', () => {
{ name: 'post', kind: 'postType', baseURL: '/wp/v2/posts' },
];
const fulfillment = deleteEntityRecord( 'postType', 'post', post );
fulfillment.next();

// delete start action
expect( fulfillment.next( entities ).value.type ).toBe(
'DELETE_ENTITY_RECORD_START'
);
// Trigger generator
fulfillment.next();

// remove items
fulfillment.next();
fulfillment.next( entities );

// delete api call
const { value: apiFetchAction } = fulfillment.next();
const { value: apiFetchAction } = fulfillment.next( entities );
expect( apiFetchAction.request ).toEqual( {
path: '/wp/v2/posts/10',
method: 'DELETE',
} );

// delete finish
expect( fulfillment.next().value.type ).toBe(
'DELETE_ENTITY_RECORD_FINISH'
);
} );
} );

Expand Down

0 comments on commit 3b74e9e

Please sign in to comment.