Skip to content

Commit

Permalink
Merge branch 'develop' into supernova/1143-expired_guest_cart
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbo authored Apr 25, 2019
2 parents efd614c + 3cc4deb commit 19ec0ba
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ describe('submitOrder', () => {
2,
checkoutReceiptActions.setOrderInformation({
id: response,
billing_address: address
billing_address: expect.any(Object)
})
);
expect(dispatch).toHaveBeenNthCalledWith(
Expand Down Expand Up @@ -547,9 +547,7 @@ describe('submitOrder', () => {
user: { isSignedIn: false }
};

getState
.mockImplementationOnce(() => mockState)
.mockImplementationOnce(() => mockState);
getState.mockImplementationOnce(() => mockState);

mockGetItem
.mockImplementationOnce(
Expand All @@ -569,7 +567,7 @@ describe('submitOrder', () => {
2,
checkoutReceiptActions.setOrderInformation({
id: response,
billing_address: address
billing_address: expect.any(Object)
})
);
expect(dispatch).toHaveBeenNthCalledWith(
Expand Down
8 changes: 4 additions & 4 deletions packages/venia-concept/src/actions/checkout/asyncActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { RestApi, Util } from '@magento/peregrine';
import { closeDrawer } from 'src/actions/app';
import { clearCartId, createCart } from 'src/actions/cart';
import { getCountries } from 'src/actions/directory';
import { getOrderInformation } from 'src/selectors/cart';
import { getAccountInformation } from 'src/selectors/checkoutReceipt';
import checkoutReceiptActions from 'src/actions/checkoutReceipt';
import actions from './actions';
Expand Down Expand Up @@ -254,9 +253,10 @@ export const submitOrder = () =>
});

dispatch(
checkoutReceiptActions.setOrderInformation(
getOrderInformation(getState(), response)
)
checkoutReceiptActions.setOrderInformation({
id: response,
billing_address
})
);

// Clear out everything we've saved about this cart from local storage.
Expand Down
8 changes: 0 additions & 8 deletions packages/venia-concept/src/selectors/cart.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
export const getOrderInformation = (
{ cart: { details: { billing_address } = {} } },
orderId
) => ({
id: orderId,
billing_address
});

export const isEmptyCartVisible = ({ cart, checkout: { step } }) =>
step === 'cart' && (!cart.details.items || cart.details.items.length === 0);

Expand Down
4 changes: 2 additions & 2 deletions pwa-devdocs/src/peregrine/routing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ class App extends Component {
render(){
...
return (
<div className={className}>
<Fragment>
<Main isMasked={overlay}>
<Page>{renderRoutingError}</Page>
</Main>
<Mask isActive={overlay} dismiss={closeDrawer} />
<Navigation isOpen={navIsOpen} />
<MiniCart isOpen={cartIsOpen} />
</div>
</Fragment>
);
}
}
Expand Down

0 comments on commit 19ec0ba

Please sign in to comment.