Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds unit tests to cart reducer #928

Merged
merged 2 commits into from
Mar 4, 2019
Merged

Adds unit tests to cart reducer #928

merged 2 commits into from
Mar 4, 2019

Conversation

supernova-at
Copy link
Contributor

@supernova-at supernova-at commented Feb 20, 2019

Description

This PR adds unit tests to reducers/cart.js.

It also does a little refactoring for sanity sake, as the reducer was returning state containing both a loading and an isLoading, which were for two completely different purposes. I renamed them and updated any code that needed to reflect the new names.

Related Issue

Closes #922 .

Motivation and Context

Part of the ongoing effort to increase unit test coverage in Venia.

How Has This Been Tested?

yarn test. See that the coverage numbers are at 100%.

Screenshots (if appropriate):

Proposed Labels for Change Type/Package

TEST

venia-concept

Checklist:

  • I have read the CONTRIBUTING document.
  • I have linked an issue to this PR.
  • I have indicated the change type and relevant package(s).
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All CI checks are green (linting, build/deploy, etc).
  • At least one core contributor has approved this PR.

@vercel
Copy link

vercel bot commented Feb 20, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

@supernova-at supernova-at added the test This pertains to testing (unit/functional/etc). label Feb 20, 2019
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 70.584% when pulling ba11265 on supernova/922 into cefdb43 on release/2.0.

@jimbo jimbo merged commit f684e69 into release/2.0 Mar 4, 2019
@jimbo jimbo deleted the supernova/922 branch March 4, 2019 20:01
supernova-at added a commit that referenced this pull request Mar 6, 2019
supernova-at pushed a commit that referenced this pull request Mar 7, 2019
* Create script for generating reference docs from source code

* Fix develop script bug that makes the server reload continuously after a change

* Clean up reference table template

* Use new auto-generated content in topics

* Update docblocks in source

* Add clean command to scripts to prevent usage of stale content between develop runs

* Run prettier

* Adds unit tests to app reducer (#921)

* Adds unit tests to app reducer
* Updates tests to be less fragile

* Add unit tests to cart reducer (#928)

* Adds unit tests to catalog reducer (#931)

* [DOCUMENTATION] cherry pick 3.0 doc updates (#992)

* Fixed typo mistake (#939)

* Fixed typo mistake (#969)

* Scroll to top on Product mount (#832)

* Create new guest cart when checkout resets (#917)
supernova-at pushed a commit that referenced this pull request Mar 21, 2019
* Merge branch 'release/2.0' of /home/d.shmaliuk/pwa-studio with conflicts.

* "Remove Item" in Minicart usability issue #661.
Added loading element in MiniCart, after delete item.

* "Remove Item" in Minicart usability issue #661.
Added check for loadingElement object.

* "Remove Item" in Minicart usability issue #661.
Added check for loadingElement object.

* "Remove Item" in Minicart usability issue #661.
Added check for loadingElement object.

* Adds unit tests to app reducer (#921)

* Adds unit tests to app reducer
* Updates tests to be less fragile

* Add unit tests to cart reducer (#928)

* Adds unit tests to catalog reducer (#931)

* [DOCUMENTATION] cherry pick 3.0 doc updates (#992)

* Fixed typo mistake (#939)

* Fixed typo mistake (#969)

* Scroll to top on Product mount (#832)

* Create new guest cart when checkout resets (#917)

* Purchase History unit tests and refactors (#891)

* Simplifies and adds tests to purchaseHistory throughout the app

* Simplifies and adds tests to purchaseHistory throughout the app

* Adds snapshot test to PurchaseHistory Filter component

* Mask specific product instead of entire cart during removeItem action

* Remove unnecessary stuff.

* Cleanup code and extra additions.

* "Remove item" in minicart usability issue #661
Solved problem in file kebab.js

* [FEATURE] "Remove item" in minicart usability issue
Refactoring minicart.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test This pertains to testing (unit/functional/etc).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants