diff --git a/js/src/data/reducer.js b/js/src/data/reducer.js index c9b208f09b..fcffb49f26 100644 --- a/js/src/data/reducer.js +++ b/js/src/data/reducer.js @@ -195,11 +195,11 @@ const reducer = ( state = DEFAULT_STATE, action ) => { } case TYPES.UPSERT_SHIPPING_TIMES: { - const { countryCodes, time } = action.shippingTime; + const { countryCodes, time, maxTime } = action.shippingTime; const times = [ ...state.mc.shipping.times ]; countryCodes.forEach( ( countryCode ) => { - const shippingTime = { countryCode, time }; + const shippingTime = { countryCode, time, maxTime }; const idx = times.findIndex( ( el ) => el.countryCode === countryCode ); diff --git a/js/src/data/test/reducer.test.js b/js/src/data/test/reducer.test.js index e7dc19bd1a..9b7d5778a2 100644 --- a/js/src/data/test/reducer.test.js +++ b/js/src/data/test/reducer.test.js @@ -261,10 +261,12 @@ describe( 'reducer', () => { { countryCode: 'US', time: 7, + maxTime: 14, }, { countryCode: 'CA', time: 12, + maxTime: 18, }, ], }; @@ -278,10 +280,12 @@ describe( 'reducer', () => { { countryCode: 'US', time: 7, + maxTime: 14, }, { countryCode: 'CA', time: 12, + maxTime: 18, }, ] ); const action = { @@ -289,6 +293,7 @@ describe( 'reducer', () => { shippingTime: { countryCodes: [ 'JP', 'CA' ], time: 15, + maxTime: 30, }, }; const state = reducer( originalState, action ); @@ -297,14 +302,17 @@ describe( 'reducer', () => { { countryCode: 'US', time: 7, + maxTime: 14, }, { countryCode: 'CA', time: 15, + maxTime: 30, }, { countryCode: 'JP', time: 15, + maxTime: 30, }, ] ); } ); @@ -314,14 +322,17 @@ describe( 'reducer', () => { { countryCode: 'US', time: 7, + maxTime: 14, }, { countryCode: 'CA', time: 12, + maxTime: 18, }, { countryCode: 'JP', time: 15, + maxTime: 30, }, ] ); const action = { @@ -334,6 +345,7 @@ describe( 'reducer', () => { { countryCode: 'CA', time: 12, + maxTime: 18, }, ] ); } );