Skip to content

Commit ade5b1e

Browse files
committed
MAGETWO-54733: Unable to save product with all unchecked values for multiple select attribute #7687
- Fix JS unit test.
1 parent 67ccb74 commit ade5b1e

File tree

1 file changed

+14
-4
lines changed
  • dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form

1 file changed

+14
-4
lines changed

dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/client.test.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ define([
1919

2020
describe('Magento_Ui/js/form/client', function () {
2121
var obj = new Constr({
22-
provider: 'provName',
23-
name: '',
24-
index: ''
25-
});
22+
provider: 'provName',
23+
name: '',
24+
index: ''
25+
}),
26+
jQueryMethods = {};
2627

2728
window.FORM_KEY = 'magentoFormKey';
2829

@@ -35,6 +36,12 @@ define([
3536
}
3637
});
3738

39+
afterEach(function () {
40+
_.each(jQueryMethods, function (value, key) {
41+
$.fn[key] = value;
42+
});
43+
});
44+
3845
describe('"save" method', function () {
3946
it('Check for defined ', function () {
4047
expect(obj.hasOwnProperty('save')).toBeDefined();
@@ -115,6 +122,7 @@ define([
115122
$.ajax = jasmine.createSpy().and.callFake(function (req) {
116123
request = req.success;
117124
});
125+
jQueryMethods.notification = $.fn.notification;
118126
$.fn.notification = jasmine.createSpy();
119127
obj.urls.beforeSave = 'requestPath';
120128
obj.save();
@@ -137,6 +145,8 @@ define([
137145
$.ajax = jasmine.createSpy().and.callFake(function (req) {
138146
request = req.complete;
139147
});
148+
149+
jQueryMethods.trigger = $.fn.trigger;
140150
$.fn.trigger = jasmine.createSpy();
141151
obj.urls.beforeSave = 'requestPath';
142152
obj.save();

0 commit comments

Comments
 (0)