Skip to content

Conversation

@laurentiumagureanu
Copy link
Contributor

Description

  • Added new Magento Storefront events to related checkout components.
  • Updated and added unit tests.

Related Issue

CIF-2119

Motivation and Context

Required by the product recommendations engine

How Has This Been Tested?

Unit tests

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

@codecov
Copy link

codecov bot commented Jun 8, 2021

Codecov Report

Merging #589 (5c0ab1c) into issue/CIF-2107 (096346f) will increase coverage by 0.26%.
The diff coverage is 96.96%.

Impacted file tree graph

@@                 Coverage Diff                  @@
##             issue/CIF-2107     #589      +/-   ##
====================================================
+ Coverage             87.44%   87.71%   +0.26%     
  Complexity             1363     1363              
====================================================
  Files                   249      249              
  Lines                  6357     6374      +17     
  Branches                943      951       +8     
====================================================
+ Hits                   5559     5591      +32     
+ Misses                  603      588      -15     
  Partials                195      195              
Flag Coverage Δ
integration 64.29% <ø> (ø)
jest 84.75% <96.96%> (+0.79%) ⬆️
karma 94.82% <ø> (ø)
unittests 87.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...act-components/src/components/Checkout/overview.js 9.52% <0.00%> (+1.83%) ⬆️
react-components/src/context/UserContext.js 90.40% <ø> (ø)
react-components/src/utils/hooks.js 96.55% <ø> (ø)
react-components/src/utils/test-utils.js 68.42% <ø> (ø)
...eact-components/src/components/Checkout/useCart.js 100.00% <100.00%> (ø)
...-components/src/components/Checkout/useOverview.js 92.50% <100.00%> (+30.43%) ⬆️
...nts/src/utils/mocks/mockMagentoStorefrontEvents.js 100.00% <100.00%> (ø)
...ponents/src/components/Checkout/checkoutContext.js 61.90% <0.00%> (+4.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 096346f...5c0ab1c. Read the comment docs.

expect(getByRole('button')).not.toBeUndefined();
await act(async () => fireEvent.click(getByRole('button')));

expect(mse.context.setOrder).toHaveBeenCalledTimes(1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it makes sense to check for the value the setOrder method was called with here.

@mhaack mhaack added the feature New feature or request label Jun 14, 2021
@laurentiumagureanu laurentiumagureanu merged commit 2e3af84 into issue/CIF-2107 Jun 14, 2021
@laurentiumagureanu laurentiumagureanu deleted the issues/CIF-2119 branch June 14, 2021 11:36
mhaack added a commit that referenced this pull request Jun 15, 2021
* CIF-2107 - Add Magento Storefront Events SDK

* CIF-2107 - Add Magento Storefront Events SDK

* CIF-2107 - Fix AEM cloudready base image version

* CIF-2107 - Add client-side foundation for Magento Storefront Events SDK

* CIF-2120: Add StorefrontEvents to PDP (#582)

* CIF-2120: Add JSON Product data to DOM

* CIF-2120: Refactor storefront context packages

* CIF-2120: format code

* CIF-2120: Rename clasees for better semantics

* CIF-2120: Add unit test

* CIF-2120: Fix JS formatting

* CIF-2120: Refactor ProductStorefrontContextImpl

* CIF-2120:  collect storefront data onDocumentReady

* CIF-2120: Fix formatting

* CIF-2118: Add StorefrontContext to productList (#583)

* CIF-2120: Add JSON Product data to DOM

* CIF-2120: Refactor storefront context packages

* CIF-2120: format code

* CIF-2120: Rename clasees for better semantics

* CIF-2120: Add unit test

* CIF-2120: Fix JS formatting

* CIF-2118: Add StorefrontContext to productList

* CIF-2120: Refactor ProductStorefrontContextImpl

* CIF-2118: Add category storefront context to dataLayer

* CIF-2118: Remove unnecessary function calls

* CIF-2120:  collect storefront data onDocumentReady

* CIF-2120: Fix formatting

* CIF-2118: collect storefront data onDocumentReady

* CIF-2121: Add SearchInput Storefront context (#585)

* CIF-2120: Add JSON Product data to DOM

* CIF-2120: Refactor storefront context packages

* CIF-2120: format code

* CIF-2120: Rename clasees for better semantics

* CIF-2120: Add unit test

* CIF-2120: Fix JS formatting

* CIF-2120: Refactor ProductStorefrontContextImpl

* CIF-2121: Add SearchInput Storefront context

* CIF-2120:  collect storefront data onDocumentReady

* CIF-2120: Fix formatting

* CIF-2121: collect storefront data onDocumentReady

* CIF-2121: Fix SearchInput storefront context

* CIF-2121: fix code styling

* CIF-2124 - Add page related storefront events (#592)

* CIF-2124 - Add customUrl and referrer Storefront Events

* CIF-2124 - Add pageView Storefront Events

* CIF-2124 - Add unit tests

* CIF-2122 - Add storefront events to UserContext (#581)

* CIF-2122 - Add storefront events to UserContext

* CIF-2122 - Add unit tests

* CIF-2119: Add storefront events to checkout components (#589)

* CIF-2119: Add storefront events to checkout

* CIF-2119: Add unit tests for checkout events

* CIF-2119: Add unit tests for checkout events

* CIF-2119: improve unit tests

* CIF-2123 - Add storefront events to Minicart (#587)

* CIF-2123 - Add storefront events to Minicart

* CIF-2123 - Add storefront events to Minicart

* CIF-2123 - Add unit tests

* CIF-2123 - Fix test failures

Co-authored-by: Laurentiu Magureanu <magurean@adobe.com>

* CIF-2107: Revert UID removal

Co-authored-by: Laurentiu Magureanu <magurean@adobe.com>
Co-authored-by: Markus Haack <mhaack@adobe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants