@@ -14,6 +14,7 @@ define([
1414 var formEl ,
1515 jQueryAjax ,
1616 order ,
17+ confirmSpy = jasmine . createSpy ( 'confirm' ) ,
1718 tmpl = '<form id="edit_form" action="/">' +
1819 '<section id="order-methods">' +
1920 '<div id="order-billing_method"></div>' +
@@ -129,7 +130,7 @@ define([
129130 mocks = {
130131 'jquery' : $ ,
131132 'Magento_Catalog/catalog/product/composite/configure' : jasmine . createSpy ( ) ,
132- 'Magento_Ui/js/modal/confirm' : jasmine . createSpy ( ) ,
133+ 'Magento_Ui/js/modal/confirm' : confirmSpy ,
133134 'Magento_Ui/js/modal/alert' : jasmine . createSpy ( ) ,
134135 'Magento_Ui/js/lib/view/utils/async' : jasmine . createSpy ( )
135136 } ;
@@ -159,6 +160,22 @@ define([
159160 jQueryAjax = undefined ;
160161 } ) ;
161162
163+ describe ( 'Testing the process customer group change' , function ( ) {
164+ it ( 'and confirm method is called' , function ( ) {
165+ init ( ) ;
166+ spyOn ( window , '$$' ) . and . returnValue ( [ 'testing' ] ) ;
167+ order . processCustomerGroupChange (
168+ 1 ,
169+ 'testMsg' ,
170+ 'customerGroupMsg' ,
171+ 'errorMsg' ,
172+ 1 ,
173+ 'change'
174+ ) ;
175+ expect ( confirmSpy ) . toHaveBeenCalledTimes ( 1 ) ;
176+ } ) ;
177+ } ) ;
178+
162179 describe ( 'submit()' , function ( ) {
163180 function testSubmit ( currentPaymentMethod , paymentMethod , ajaxParams ) {
164181 $ . ajax = jasmine . createSpy ( '$.ajax' ) ;
0 commit comments