@@ -8,52 +8,49 @@ define([
88] , function ( Squire ) {
99 'use strict' ;
1010
11- describe ( 'Magento_CheckoutAgreements/js/model/set-payment-information-mixin' , function ( ) {
12- var injector = new Squire ( ) ,
13- mocks = {
14- 'Magento_Checkout/js/action/set-payment-information' : jasmine . createSpy ( 'placeOrderAction' ) ,
15- 'Magento_CheckoutAgreements/js/model/agreements-assigner' : jasmine . createSpy ( 'agreementsAssigner' )
16- } ,
17- defaultContext = require . s . contexts . _ ,
18- mixin ,
19- placeOrderAction ;
11+ var injector = new Squire ( ) ,
12+ mocks = {
13+ 'Magento_Checkout/js/action/set-payment-information' : jasmine . createSpy ( 'placeOrderAction' ) ,
14+ 'Magento_CheckoutAgreements/js/model/agreements-assigner' : jasmine . createSpy ( 'agreementsAssigner' )
15+ } ,
16+ defaultContext = require . s . contexts . _ ,
17+ mixin ,
18+ placeOrderAction ;
2019
21- beforeEach ( function ( done ) {
22- window . checkoutConfig = {
23- checkoutAgreements : {
24- isEnabled : true
25- }
26- } ;
27- injector . mock ( mocks ) ;
28- injector . require ( [
29- 'Magento_CheckoutAgreements/js/model/set-payment-information-mixin' ,
30- 'Magento_Checkout/js/action/set-payment-information'
31- ] , function ( Mixin , setPaymentInformation ) {
32- mixin = Mixin ;
33- placeOrderAction = setPaymentInformation ;
34- done ( ) ;
35- } ) ;
20+ beforeEach ( function ( done ) {
21+ window . checkoutConfig = {
22+ checkoutAgreements : {
23+ isEnabled : true
24+ }
25+ } ;
26+ injector . mock ( mocks ) ;
27+ injector . require ( [
28+ 'Magento_CheckoutAgreements/js/model/set-payment-information-mixin' ,
29+ 'Magento_Checkout/js/action/set-payment-information'
30+ ] , function ( Mixin , setPaymentInformation ) {
31+ mixin = Mixin ;
32+ placeOrderAction = setPaymentInformation ;
33+ done ( ) ;
3634 } ) ;
35+ } ) ;
3736
38- describe ( 'Magento_Checkout /js/action /set-payment-information' , function ( ) {
39- it ( 'Magento_CheckoutAgreements /js/model /set-payment-information-mixin is applied ', function ( ) {
40- var placeOrderMixins = defaultContext
41- . config . config . mixins [ 'Magento_Checkout/js/action/set-payment-information' ] ;
37+ describe ( 'Magento_CheckoutAgreements /js/model /set-payment-information-mixin ' , function ( ) {
38+ it ( 'mixin is applied to Magento_Checkout /js/action /set-payment-information', function ( ) {
39+ var placeOrderMixins = defaultContext
40+ . config . config . mixins [ 'Magento_Checkout/js/action/set-payment-information' ] ;
4241
43- expect ( placeOrderMixins [ 'Magento_CheckoutAgreements/js/model/set-payment-information-mixin' ] )
44- . toBe ( true ) ;
45- } ) ;
42+ expect ( placeOrderMixins [ 'Magento_CheckoutAgreements/js/model/set-payment-information-mixin' ] ) . toBe ( true ) ;
43+ } ) ;
4644
47- it ( 'Magento_CheckoutAgreements/js/model/agreements-assigner is called' , function ( ) {
48- var messageContainer = jasmine . createSpy ( 'messageContainer' ) ,
49- paymentData = { } ;
45+ it ( 'Magento_CheckoutAgreements/js/model/agreements-assigner is called' , function ( ) {
46+ var messageContainer = jasmine . createSpy ( 'messageContainer' ) ,
47+ paymentData = { } ;
5048
51- mixin ( placeOrderAction ) ( messageContainer , paymentData ) ;
52- expect ( mocks [ 'Magento_CheckoutAgreements/js/model/agreements-assigner' ] )
53- . toHaveBeenCalledWith ( paymentData ) ;
54- expect ( mocks [ 'Magento_Checkout/js/action/set-payment-information' ] )
55- . toHaveBeenCalledWith ( messageContainer , paymentData ) ;
56- } ) ;
49+ mixin ( placeOrderAction ) ( messageContainer , paymentData ) ;
50+ expect ( mocks [ 'Magento_CheckoutAgreements/js/model/agreements-assigner' ] )
51+ . toHaveBeenCalledWith ( paymentData ) ;
52+ expect ( mocks [ 'Magento_Checkout/js/action/set-payment-information' ] )
53+ . toHaveBeenCalledWith ( messageContainer , paymentData ) ;
5754 } ) ;
5855 } ) ;
5956} ) ;
0 commit comments