Skip to content

Conversation

@laurentiumagureanu
Copy link
Contributor

Description

Render storefront context data based on config

Related Issue

CIF-2222

Motivation and Context

product recs

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.

public String getJson() {
try {
return new ObjectMapper().writeValueAsString(this);
if (isStorefrontContextEnabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a test that covers the isStorefrontContextEnabled() = false case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added now

@herzog31 herzog31 added the enhancement New feature or request label Jul 21, 2021
@herzog31
Copy link
Member

LGTM

As @buuhuu mentioned, please add a test case to test the behavior if the setting is disabled.

@laurentiumagureanu
Copy link
Contributor Author

LGTM

As @buuhuu mentioned, please add a test case to test the behavior if the setting is disabled.

added now

@codecov
Copy link

codecov bot commented Jul 21, 2021

Codecov Report

Merging #632 (344b91c) into master (09fdd3c) will decrease coverage by 0.03%.
The diff coverage is 79.16%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #632      +/-   ##
============================================
- Coverage     88.03%   87.99%   -0.04%     
- Complexity     1526     1527       +1     
============================================
  Files           278      278              
  Lines          6777     6789      +12     
  Branches       1009     1011       +2     
============================================
+ Hits           5966     5974       +8     
  Misses          620      620              
- Partials        191      195       +4     
Flag Coverage Δ
integration 61.56% <70.83%> (-1.55%) ⬇️
jest 85.61% <ø> (ø)
karma 89.05% <ø> (ø)
unittests 88.32% <79.16%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
...mmerce/core/components/models/product/Product.java 100.00% <ø> (ø)
...ore/components/models/productlist/ProductList.java 100.00% <ø> (ø)
...rontcontext/AbstractCommerceStorefrontContext.java 72.22% <68.75%> (+22.22%) ⬆️
...onents/internal/models/v1/product/ProductImpl.java 88.73% <100.00%> (ø)
...nternal/models/v1/productlist/ProductListImpl.java 94.73% <100.00%> (ø)
...nal/models/v1/searchresults/SearchResultsImpl.java 100.00% <100.00%> (ø)
...orefrontcontext/CategoryStorefrontContextImpl.java 100.00% <100.00%> (ø)
...torefrontcontext/ProductStorefrontContextImpl.java 100.00% <100.00%> (ø)
...ontcontext/SearchResultsStorefrontContextImpl.java 90.00% <100.00%> (-10.00%) ⬇️
...storefrontcontext/SearchStorefrontContextImpl.java 100.00% <100.00%> (ø)
... and 1 more

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 09fdd3c...344b91c. Read the comment docs.

@buuhuu buuhuu merged commit eed7147 into master Jul 22, 2021
@buuhuu buuhuu deleted the issues/CIF-2222 branch July 22, 2021 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants