File tree 1 file changed +10
-1
lines changed
dev/tests/js/jasmine/tests/app/code/Magento/Multishipping/frontend/js
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -68,9 +68,11 @@ define([
68
68
var addNewAddressBtn ,
69
69
addressflag ,
70
70
canContinueBtn ,
71
- canContinueFlag ;
71
+ canContinueFlag ,
72
+ originalGetJSON ;
72
73
73
74
beforeEach ( function ( ) {
75
+ originalGetJSON = $ . getJSON ;
74
76
addNewAddressBtn = $ ( '<button type="button" data-role="add-new-address"/>' ) ;
75
77
addressflag = $ ( '<input type="hidden" value="0" id="add_new_address_flag"/>' ) ;
76
78
canContinueBtn = $ ( '<button type="submit" data-role="can-continue" data-flag="1"/>' ) ;
@@ -79,13 +81,20 @@ define([
79
81
. append ( addressflag )
80
82
. append ( canContinueBtn )
81
83
. append ( canContinueFlag ) ;
84
+
85
+ $ . getJSON = jasmine . createSpy ( ) . and . callFake ( function ( ) {
86
+ var deferred = $ . Deferred ( ) ;
87
+
88
+ return deferred . promise ( ) ;
89
+ } ) ;
82
90
} ) ;
83
91
84
92
afterEach ( function ( ) {
85
93
addNewAddressBtn . remove ( ) ;
86
94
addressflag . remove ( ) ;
87
95
canContinueBtn . remove ( ) ;
88
96
canContinueFlag . remove ( ) ;
97
+ $ . getJSON = originalGetJSON ;
89
98
} ) ;
90
99
91
100
it ( 'Check add new address event' , function ( ) {
You can’t perform that action at this time.
0 commit comments