mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-07 07:36:58 +00:00
Merge pull request #6528 from mprieger/5546-cart-page-last-item-deletion
Fix users removing last item of confirmed order on /cart page
This commit is contained in:
@@ -222,6 +222,13 @@ describe 'Cart service', ->
|
||||
expect(li.quantity).toEqual 1
|
||||
expect(li.max_quantity).toEqual 1
|
||||
|
||||
describe "when modifying a confirmed order", ->
|
||||
it "displays flash error when attempting to remove final item", ->
|
||||
spyOn(RailsFlashLoader, 'loadFlash')
|
||||
li = {variant: {id: 1}, quantity: 3}
|
||||
Cart.line_items_finalised = [li]
|
||||
expect(Cart.has_one_line_item()).toBe(true)
|
||||
|
||||
it "pops the queue", ->
|
||||
Cart.update_enqueued = true
|
||||
spyOn(Cart, 'scheduleUpdate')
|
||||
|
||||
Reference in New Issue
Block a user