File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
app/code/Magento/Sales/view/adminhtml/web/order/create
dev/tests/js/jasmine/tests/app/code/Magento/Sales/adminhtml/js/order/create Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 157157 this . sidebarShow ( ) ;
158158 //this.loadArea(['header', 'sidebar','data'], true);
159159 this . dataShow ( ) ;
160- this . loadArea ( [ 'header' , 'data' ] , true ) ;
161- location . reload ( ) ;
160+ this . loadArea (
161+ [ 'header' , 'data' ] ,
162+ true ,
163+ null ,
164+ function ( ) {
165+ location . reload ( ) ;
166+ }
167+ ) ;
162168 } ,
163169
164170 setCurrencyId : function ( id ) {
11641170 }
11651171 } ,
11661172
1167- loadArea : function ( area , indicator , params ) {
1173+ loadArea : function ( area , indicator , params , callback ) {
11681174 var deferred = new jQuery . Deferred ( ) ;
11691175 var url = this . loadBaseUrl ;
11701176 if ( area ) {
11831189 onSuccess : function ( transport ) {
11841190 var response = transport . responseText . evalJSON ( ) ;
11851191 this . loadAreaResponseHandler ( response ) ;
1192+ if ( callback instanceof Function ) {
1193+ callback ( ) ;
1194+ }
11861195 deferred . resolve ( ) ;
11871196 } . bind ( this )
11881197 } ) ;
Original file line number Diff line number Diff line change @@ -160,6 +160,16 @@ define([
160160 jQueryAjax = undefined ;
161161 } ) ;
162162
163+ it ( 'test that setStoreId calls loadArea with a callback' , function ( ) {
164+ init ( ) ;
165+ spyOn ( order , 'loadArea' ) . and . callFake ( function ( ) {
166+ expect ( arguments . length ) . toEqual ( 4 ) ;
167+ expect ( arguments [ 3 ] instanceof Function ) . toBeTrue ( ) ;
168+ } ) ;
169+ order . setStoreId ( 'id' ) ;
170+ expect ( order . loadArea ) . toHaveBeenCalled ( ) ;
171+ } ) ;
172+
163173 describe ( 'Testing the process customer group change' , function ( ) {
164174 it ( 'and confirm method is called' , function ( ) {
165175 init ( ) ;
You can’t perform that action at this time.
0 commit comments