File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,11 @@ define([
19
19
20
20
describe ( 'Magento_Ui/js/form/client' , function ( ) {
21
21
var obj = new Constr ( {
22
- provider : 'provName' ,
23
- name : '' ,
24
- index : ''
25
- } ) ;
22
+ provider : 'provName' ,
23
+ name : '' ,
24
+ index : ''
25
+ } ) ,
26
+ jQueryMethods = { } ;
26
27
27
28
window . FORM_KEY = 'magentoFormKey' ;
28
29
@@ -35,6 +36,12 @@ define([
35
36
}
36
37
} ) ;
37
38
39
+ afterEach ( function ( ) {
40
+ _ . each ( jQueryMethods , function ( value , key ) {
41
+ $ . fn [ key ] = value ;
42
+ } ) ;
43
+ } ) ;
44
+
38
45
describe ( '"save" method' , function ( ) {
39
46
it ( 'Check for defined ' , function ( ) {
40
47
expect ( obj . hasOwnProperty ( 'save' ) ) . toBeDefined ( ) ;
@@ -115,6 +122,7 @@ define([
115
122
$ . ajax = jasmine . createSpy ( ) . and . callFake ( function ( req ) {
116
123
request = req . success ;
117
124
} ) ;
125
+ jQueryMethods . notification = $ . fn . notification ;
118
126
$ . fn . notification = jasmine . createSpy ( ) ;
119
127
obj . urls . beforeSave = 'requestPath' ;
120
128
obj . save ( ) ;
@@ -137,6 +145,8 @@ define([
137
145
$ . ajax = jasmine . createSpy ( ) . and . callFake ( function ( req ) {
138
146
request = req . complete ;
139
147
} ) ;
148
+
149
+ jQueryMethods . trigger = $ . fn . trigger ;
140
150
$ . fn . trigger = jasmine . createSpy ( ) ;
141
151
obj . urls . beforeSave = 'requestPath' ;
142
152
obj . save ( ) ;
You can’t perform that action at this time.
0 commit comments