mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Convert all calls to variant.count_on_hand to variant.on_hand
This commit is contained in:
@@ -145,11 +145,11 @@ describe 'Cart service', ->
|
||||
expect(li.max_quantity).toEqual 0
|
||||
|
||||
it "resets the count on hand available", ->
|
||||
li = {variant: {id: 1, count_on_hand: 10}, quantity: 5}
|
||||
li = {variant: {id: 1, on_hand: 10}, quantity: 5}
|
||||
Cart.line_items = [li]
|
||||
stockLevels = {1: {quantity: 0, max_quantity: 0, on_hand: 0}}
|
||||
Cart.compareAndNotifyStockLevels stockLevels
|
||||
expect(li.variant.count_on_hand).toEqual 0
|
||||
expect(li.variant.on_hand).toEqual 0
|
||||
|
||||
describe "when the quantity available is less than that requested", ->
|
||||
it "reduces the quantity in the cart", ->
|
||||
@@ -172,7 +172,7 @@ describe 'Cart service', ->
|
||||
Cart.line_items = [li]
|
||||
stockLevels = {1: {quantity: 5, on_hand: 6}}
|
||||
Cart.compareAndNotifyStockLevels stockLevels
|
||||
expect(li.variant.count_on_hand).toEqual 6
|
||||
expect(li.variant.on_hand).toEqual 6
|
||||
|
||||
describe "when the client-side quantity has been increased during the request", ->
|
||||
it "does not reset the quantity", ->
|
||||
|
||||
Reference in New Issue
Block a user