Make sure batch fetch resolved data remains consistent (https://github.com/woocommerce/woocommerce-admin/pull/7587)

* Adjust batch fetch logic so data stays the same

* Fix receive options action call

* Resolve returned result

* Add missing await
This commit is contained in:
louwie17 2021-09-08 09:37:44 -03:00 committed by GitHub
parent 13fe7c4c7a
commit e6cf391141
3 changed files with 6 additions and 2 deletions

View File

@ -99,7 +99,7 @@ const testAdminHomescreenActivityPanel = () => {
describe( 'Orders panel', () => { describe( 'Orders panel', () => {
it( 'should show: "you have fullfilled all your orders" when expanding Orders panel if no actionable orders', async () => { it( 'should show: "you have fullfilled all your orders" when expanding Orders panel if no actionable orders', async () => {
await homeScreen.expandActivityPanel( 'Orders' ); await homeScreen.expandActivityPanel( 'Orders' );
expect( page ).toMatchElement( 'h4', { await expect( page ).toMatchElement( 'h4', {
text: 'Youve fulfilled all your orders', text: 'Youve fulfilled all your orders',
} ); } );
} ); } );

View File

@ -1,3 +1,7 @@
# Unreleased
- Fix the batch fetch logic for the options data store. #7587
# 1.4.0 # 1.4.0
- Fix commonjs module build, allow package to be built in isolation. #7286 - Fix commonjs module build, allow package to be built in isolation. #7286

View File

@ -29,7 +29,7 @@ export const controls = {
const names = optionNames.join( ',' ); const names = optionNames.join( ',' );
if ( fetches[ names ] ) { if ( fetches[ names ] ) {
return fetches[ names ].then( ( result ) => { return fetches[ names ].then( ( result ) => {
resolve( result[ optionName ] ); resolve( result );
} ); } );
} }