mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Adjust specs for new cart display
This commit is contained in:
@@ -49,25 +49,9 @@ describe 'Variants service', ->
|
||||
variant = {product_name: 'product_name', name_to_display: 'product_name'}
|
||||
expect(Variants.extendedVariantName(variant)).toEqual "product_name"
|
||||
|
||||
it "includes the options text even if variant name is same as product", ->
|
||||
variant =
|
||||
product_name: 'product_name'
|
||||
name_to_display: 'product_name'
|
||||
options_text: 'options_text'
|
||||
|
||||
expect(Variants.extendedVariantName(variant)).toEqual "product_name (options_text)"
|
||||
|
||||
describe "when the product name and the variant name differ", ->
|
||||
it "returns a combined name when there is no options text", ->
|
||||
variant =
|
||||
product_name: 'product_name'
|
||||
name_to_display: 'name_to_display'
|
||||
expect(Variants.extendedVariantName(variant)).toEqual "product_name - name_to_display"
|
||||
|
||||
it "returns a combined name when there is some options text", ->
|
||||
variant =
|
||||
product_name: 'product_name'
|
||||
name_to_display: 'name_to_display'
|
||||
options_text: 'options_text'
|
||||
|
||||
expect(Variants.extendedVariantName(variant)).toEqual "product_name - name_to_display (options_text)"
|
||||
|
||||
Reference in New Issue
Block a user