@@ -694,10 +694,11 @@ describe('Cart class', () => {
694694 const modelId = 135 ;
695695 const variantId = 1111 ;
696696 const quantity = 2 ;
697+ const customAttributes = [ ] ;
697698 const variant = {
698699 id : variantId ,
699700 } ;
700- const lineItem = { variantId, quantity} ;
701+ const lineItem = { variantId, quantity, customAttributes } ;
701702 let cartOpenStub ;
702703 let setFocusStub ;
703704 let addLineItemsStub ;
@@ -741,13 +742,13 @@ describe('Cart class', () => {
741742 } ) ;
742743
743744 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 ( ( ) => {
745746 assert . calledOnce ( cartOpenStub ) ;
746747 } ) ;
747748 } ) ;
748749
749750 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 ( ( ) => {
751752 assert . notCalled ( cartOpenStub ) ;
752753 } ) ;
753754 } ) ;
@@ -758,7 +759,7 @@ describe('Cart class', () => {
758759 } ;
759760
760761 return cart . addVariantToCart ( variant ) . then ( ( ) => {
761- assert . calledWith ( addLineItemsStub , modelId , [ { variantId, quantity : 1 } ] ) ;
762+ assert . calledWith ( addLineItemsStub , modelId , [ { variantId, quantity : 1 , customAttributes : [ ] } ] ) ;
762763 } ) ;
763764 } ) ;
764765
@@ -779,13 +780,13 @@ describe('Cart class', () => {
779780 } ) ;
780781
781782 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 ( ( ) => {
783784 assert . notCalled ( setFocusStub ) ;
784785 } ) ;
785786 } ) ;
786787
787788 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 ( ( ) => {
789790 assert . calledOnce ( setFocusStub ) ;
790791 } ) ;
791792 } ) ;
@@ -805,19 +806,19 @@ describe('Cart class', () => {
805806 it ( 'creates a checkout with line item and returns the updated checkout if cart model is null' , ( ) => {
806807 return cart . addVariantToCart ( variant , quantity ) . then ( ( checkout ) => {
807808 assert . calledOnce ( checkoutCreateStub ) ;
808- assert . calledWith ( checkoutCreateStub , { lineItems : [ lineItem ] } ) ;
809+ assert . calledWith ( checkoutCreateStub , { lineItems : [ lineItem ] , customAttributes : [ ] } ) ;
809810 assert . deepEqual ( checkout , mockCheckout ) ;
810811 } ) ;
811812 } ) ;
812813
813814 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 ( ( ) => {
815816 assert . notCalled ( setFocusStub ) ;
816817 } ) ;
817818 } ) ;
818819
819820 it ( 'calls setFocus if openCart parameter is false' , ( ) => {
820- return cart . addVariantToCart ( variant , quantity , false ) . then ( ( ) => {
821+ return cart . addVariantToCart ( variant , quantity , [ ] , false ) . then ( ( ) => {
821822 assert . calledOnce ( setFocusStub ) ;
822823 } ) ;
823824 } ) ;
0 commit comments