File tree Expand file tree Collapse file tree 4 files changed +26
-7
lines changed
dev/tests/js/jasmine/tests/app/code/Magento
Catalog/adminhtml/js/components
Review/view/frontend/web/js Expand file tree Collapse file tree 4 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,12 @@ define([
13
13
'use strict' ;
14
14
15
15
describe ( 'Magento_Catalog/js/components/product-ui-select' , function ( ) {
16
- var obj ;
16
+ var obj ,
17
+ originaljQueryAjax ;
17
18
18
19
beforeEach ( function ( ) {
20
+ originaljQueryAjax = $ . ajax ;
21
+
19
22
obj = new Constr ( {
20
23
name : 'productUiSelect' ,
21
24
dataScope : '' ,
@@ -25,6 +28,10 @@ define([
25
28
} ) ;
26
29
} ) ;
27
30
31
+ afterEach ( function ( ) {
32
+ $ . ajax = originaljQueryAjax ;
33
+ } ) ;
34
+
28
35
describe ( '"validateInitialValue" method' , function ( ) {
29
36
it ( 'Should be defined' , function ( ) {
30
37
expect ( obj . hasOwnProperty ( 'validateInitialValue' ) ) . toBeDefined ( ) ;
Original file line number Diff line number Diff line change @@ -14,18 +14,21 @@ define([
14
14
15
15
describe ( 'Test product page reviews processor' , function ( ) {
16
16
var element ,
17
- config = {
18
- reviewsTabSelector : '#review-tab'
19
- } ;
17
+ originaljQueryAjax ,
18
+ config = {
19
+ reviewsTabSelector : '#review-tab'
20
+ } ;
20
21
21
22
beforeEach ( function ( ) {
22
23
element = $ ( '<div id="review-tab" role="tab"></div>' ) ;
23
24
24
25
$ ( 'body' ) . append ( element ) ;
26
+ originaljQueryAjax = $ . ajax ;
25
27
} ) ;
26
28
27
29
afterEach ( function ( ) {
28
30
element . remove ( ) ;
31
+ $ . ajax = originaljQueryAjax ;
29
32
} ) ;
30
33
31
34
it ( 'Should automatically load reviews after page load if review tab is active' , function ( ) {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ define([
20
20
index : ''
21
21
} ) ,
22
22
jQueryMethods = { } ,
23
- ajax = $ . ajax ;
23
+ originaljQueryAjax ;
24
24
25
25
window . FORM_KEY = 'magentoFormKey' ;
26
26
@@ -38,11 +38,15 @@ define([
38
38
}
39
39
} ) ;
40
40
41
+ beforeEach ( function ( ) {
42
+ originaljQueryAjax = $ . ajax ;
43
+ } ) ;
44
+
41
45
afterEach ( function ( ) {
42
46
_ . each ( jQueryMethods , function ( value , key ) {
43
47
$ . fn [ key ] = value ;
44
48
} ) ;
45
- $ . ajax = ajax ;
49
+
46
50
} ) ;
47
51
48
52
describe ( '"save" method' , function ( ) {
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ define([
14
14
'use strict' ;
15
15
16
16
describe ( 'Magento_Ui/js/form/element/ui-select' , function ( ) {
17
- var obj ;
17
+ var obj , originaljQueryAjax ;
18
18
19
19
beforeEach ( function ( ) {
20
20
obj = new Constr ( {
@@ -25,6 +25,11 @@ define([
25
25
26
26
obj . value = ko . observableArray ( [ ] ) ;
27
27
obj . cacheOptions . plain = [ ] ;
28
+ originaljQueryAjax = $ . ajax ;
29
+ } ) ;
30
+
31
+ afterEach ( function ( ) {
32
+ $ . ajax = originaljQueryAjax ;
28
33
} ) ;
29
34
30
35
describe ( '"initialize" method' , function ( ) {
You can’t perform that action at this time.
0 commit comments