From ff6da60030f522137d967c8977bcf1f78d5b536d Mon Sep 17 00:00:00 2001 From: Andrei Draganescu Date: Thu, 11 Jun 2020 16:13:40 +0300 Subject: [PATCH] fixes test after reming superfluous actions from deleteEntityRecord --- packages/core-data/src/test/actions.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/core-data/src/test/actions.js b/packages/core-data/src/test/actions.js index bb87920294c54..30ae46ccced8d 100644 --- a/packages/core-data/src/test/actions.js +++ b/packages/core-data/src/test/actions.js @@ -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' - ); } ); } );