Adjust specs for new cart display

This commit is contained in:
Matt-Yorkley
2020-05-22 15:39:10 +02:00
parent 2f2ef28351
commit 459e53f43d
6 changed files with 24 additions and 39 deletions

View File

@@ -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)"