Skip to content

Commit

Permalink
MAGETWO-54733: Unable to save product with all unchecked values for m…
Browse files Browse the repository at this point in the history
…ultiple select attribute #7687

- Fix JS unit test.
  • Loading branch information
VladimirZaets committed Jan 27, 2017
1 parent 67ccb74 commit ade5b1e
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ define([

describe('Magento_Ui/js/form/client', function () {
var obj = new Constr({
provider: 'provName',
name: '',
index: ''
});
provider: 'provName',
name: '',
index: ''
}),
jQueryMethods = {};

window.FORM_KEY = 'magentoFormKey';

Expand All @@ -35,6 +36,12 @@ define([
}
});

afterEach(function () {
_.each(jQueryMethods, function (value, key) {
$.fn[key] = value;
});
});

describe('"save" method', function () {
it('Check for defined ', function () {
expect(obj.hasOwnProperty('save')).toBeDefined();
Expand Down Expand Up @@ -115,6 +122,7 @@ define([
$.ajax = jasmine.createSpy().and.callFake(function (req) {
request = req.success;
});
jQueryMethods.notification = $.fn.notification;
$.fn.notification = jasmine.createSpy();
obj.urls.beforeSave = 'requestPath';
obj.save();
Expand All @@ -137,6 +145,8 @@ define([
$.ajax = jasmine.createSpy().and.callFake(function (req) {
request = req.complete;
});

jQueryMethods.trigger = $.fn.trigger;
$.fn.trigger = jasmine.createSpy();
obj.urls.beforeSave = 'requestPath';
obj.save();
Expand Down

0 comments on commit ade5b1e

Please sign in to comment.