Include option text in dropdown cart even if the variant and product have the same name

This commit is contained in:
stveep
2018-03-25 12:32:33 +01:00
committed by Maikel Linke
parent a2e4c33922
commit 46d2d6cb8a
2 changed files with 11 additions and 3 deletions

View File

@@ -49,6 +49,14 @@ 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 =