Skip to content

Commit

Permalink
MAGETWO-71670: Fix issue #10565 #10575
Browse files Browse the repository at this point in the history
  • Loading branch information
ishakhsuvarov authored Aug 19, 2017
2 parents fc28ea6 + fcb90c9 commit 16006c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ define([
* @param {Array} data - current component value
*/
setPrepareToSendData: function (data) {
if (!data.length) {
if (_.isUndefined(data) || !data.length) {
data = '';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ define([
expect(obj.source.set).toHaveBeenCalledWith(dataScope + '-prepared-for-send', '');
});

it('Check method call with undefined as parameter.', function () {

expect(obj.setPrepareToSendData(undefined)).toBeUndefined();
expect(obj.source.set).toHaveBeenCalledWith(dataScope + '-prepared-for-send', '');
});

it('Check method call with array with data as parameter.', function () {
expect(obj.setPrepareToSendData(['1', '2', '3'])).toBeUndefined();
expect(obj.source.set).toHaveBeenCalledWith(dataScope + '-prepared-for-send', ['1', '2', '3']);
Expand Down

0 comments on commit 16006c5

Please sign in to comment.