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 157
157
this . sidebarShow ( ) ;
158
158
//this.loadArea(['header', 'sidebar','data'], true);
159
159
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
+ ) ;
162
168
} ,
163
169
164
170
setCurrencyId : function ( id ) {
1164
1170
}
1165
1171
} ,
1166
1172
1167
- loadArea : function ( area , indicator , params ) {
1173
+ loadArea : function ( area , indicator , params , callback ) {
1168
1174
var deferred = new jQuery . Deferred ( ) ;
1169
1175
var url = this . loadBaseUrl ;
1170
1176
if ( area ) {
1183
1189
onSuccess : function ( transport ) {
1184
1190
var response = transport . responseText . evalJSON ( ) ;
1185
1191
this . loadAreaResponseHandler ( response ) ;
1192
+ if ( callback instanceof Function ) {
1193
+ callback ( ) ;
1194
+ }
1186
1195
deferred . resolve ( ) ;
1187
1196
} . bind ( this )
1188
1197
} ) ;
Original file line number Diff line number Diff line change @@ -160,6 +160,16 @@ define([
160
160
jQueryAjax = undefined ;
161
161
} ) ;
162
162
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
+
163
173
describe ( 'Testing the process customer group change' , function ( ) {
164
174
it ( 'and confirm method is called' , function ( ) {
165
175
init ( ) ;
You can’t perform that action at this time.
0 commit comments