@@ -694,10 +694,11 @@ describe('Cart class', () => {
694
694
const modelId = 135 ;
695
695
const variantId = 1111 ;
696
696
const quantity = 2 ;
697
+ const customAttributes = [ ] ;
697
698
const variant = {
698
699
id : variantId ,
699
700
} ;
700
- const lineItem = { variantId, quantity} ;
701
+ const lineItem = { variantId, quantity, customAttributes } ;
701
702
let cartOpenStub ;
702
703
let setFocusStub ;
703
704
let addLineItemsStub ;
@@ -741,13 +742,13 @@ describe('Cart class', () => {
741
742
} ) ;
742
743
743
744
it ( 'calls open on cart if openCart parameter is true' , ( ) => {
744
- return cart . addVariantToCart ( variant , quantity , true ) . then ( ( ) => {
745
+ return cart . addVariantToCart ( variant , quantity , [ ] , true ) . then ( ( ) => {
745
746
assert . calledOnce ( cartOpenStub ) ;
746
747
} ) ;
747
748
} ) ;
748
749
749
750
it ( 'does not call open on cart if openCart parameter is false' , ( ) => {
750
- return cart . addVariantToCart ( variant , quantity , false ) . then ( ( ) => {
751
+ return cart . addVariantToCart ( variant , quantity , [ ] , false ) . then ( ( ) => {
751
752
assert . notCalled ( cartOpenStub ) ;
752
753
} ) ;
753
754
} ) ;
@@ -758,7 +759,7 @@ describe('Cart class', () => {
758
759
} ;
759
760
760
761
return cart . addVariantToCart ( variant ) . then ( ( ) => {
761
- assert . calledWith ( addLineItemsStub , modelId , [ { variantId, quantity : 1 } ] ) ;
762
+ assert . calledWith ( addLineItemsStub , modelId , [ { variantId, quantity : 1 , customAttributes : [ ] } ] ) ;
762
763
} ) ;
763
764
} ) ;
764
765
@@ -779,13 +780,13 @@ describe('Cart class', () => {
779
780
} ) ;
780
781
781
782
it ( 'does not call setFocus if the openCart parameter is true' , ( ) => {
782
- return cart . addVariantToCart ( variant , quantity , true ) . then ( ( ) => {
783
+ return cart . addVariantToCart ( variant , quantity , [ ] , true ) . then ( ( ) => {
783
784
assert . notCalled ( setFocusStub ) ;
784
785
} ) ;
785
786
} ) ;
786
787
787
788
it ( 'calls setFocus if the openCart parameter is false' , ( ) => {
788
- return cart . addVariantToCart ( variant , quantity , false ) . then ( ( ) => {
789
+ return cart . addVariantToCart ( variant , quantity , [ ] , false ) . then ( ( ) => {
789
790
assert . calledOnce ( setFocusStub ) ;
790
791
} ) ;
791
792
} ) ;
@@ -805,19 +806,19 @@ describe('Cart class', () => {
805
806
it ( 'creates a checkout with line item and returns the updated checkout if cart model is null' , ( ) => {
806
807
return cart . addVariantToCart ( variant , quantity ) . then ( ( checkout ) => {
807
808
assert . calledOnce ( checkoutCreateStub ) ;
808
- assert . calledWith ( checkoutCreateStub , { lineItems : [ lineItem ] } ) ;
809
+ assert . calledWith ( checkoutCreateStub , { lineItems : [ lineItem ] , customAttributes : [ ] } ) ;
809
810
assert . deepEqual ( checkout , mockCheckout ) ;
810
811
} ) ;
811
812
} ) ;
812
813
813
814
it ( 'does not call setFocus if the openCart parameter is true' , ( ) => {
814
- return cart . addVariantToCart ( variant , quantity , true ) . then ( ( ) => {
815
+ return cart . addVariantToCart ( variant , quantity , [ ] , true ) . then ( ( ) => {
815
816
assert . notCalled ( setFocusStub ) ;
816
817
} ) ;
817
818
} ) ;
818
819
819
820
it ( 'calls setFocus if openCart parameter is false' , ( ) => {
820
- return cart . addVariantToCart ( variant , quantity , false ) . then ( ( ) => {
821
+ return cart . addVariantToCart ( variant , quantity , [ ] , false ) . then ( ( ) => {
821
822
assert . calledOnce ( setFocusStub ) ;
822
823
} ) ;
823
824
} ) ;
0 commit comments