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

Calling "cart/removeFromCart" with a quantity does not decrement the quantity #1003

Closed
brent-hoover opened this issue May 4, 2016 · 3 comments
Assignees
Milestone

Comments

@brent-hoover
Copy link
Collaborator

brent-hoover commented May 4, 2016

Expected behavior

Calling "cart/removeFromCart" with a quantity should decrement the quantity for that cartItem

Actual Behavior

Quantity is not decremented

Steps to Reproduce the Behavior

I don't believe this functionality is currently used in the stock shop since we don't currently allow you to change quantities.

  1. Add an item to the cart
  2. Execute ReactionCore.Collections.Cart.findOne() in the browser console to get the current cart
  3. Observe the quantity is 1
  4. Store the cart Item ID
  5. Execute Meteor.call("cart/removeFromCart", , 1);
  6. Observe there is no error
  7. Execute ReactionCore.Collections.Cart.findOne() again (or however you want to look at the db)
  8. Observe that the quantity is still 1

Additionally there probably needs to be a check that if the decrement brings the quantity to <= 0 that the item should just be removed. I also don't see a test for this but I will try to add one if it's missing.

Looking at the method code I can't see why this isn't working. The Mongo call returns a 1 and the values seem to be correct.

@brent-hoover brent-hoover added this to the v0.13.0 milestone May 4, 2016
@brent-hoover
Copy link
Collaborator Author

There's a note in the cart tests
// fixme: we expect decrease the number of items, but this does not
// occur by some unknown reason

@aaronjudd
Copy link
Contributor

@jshimko @zenweasel I think this should make into 0.14.. what do you think?

@aaronjudd aaronjudd added ready and removed backlog labels Jun 28, 2016
@aaronjudd aaronjudd modified the milestones: v0.14.0, v0.15.0 RC Jun 30, 2016
@brent-hoover brent-hoover removed their assignment Jul 21, 2016
@brent-hoover brent-hoover self-assigned this Aug 4, 2016
@brent-hoover
Copy link
Collaborator Author

Closed via #1273

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants