Skip to content

Commit 69c2954

Browse files
committed
MAGETWO-62856: JSUnit job is failed on current mainline
1 parent 6868558 commit 69c2954

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/datepicker.test.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,40 @@ define([
1818
config;
1919

2020
beforeEach(function () {
21-
element = $('<input />');
21+
element = $('<input />');
2222
observable = ko.observable();
2323

2424
config = {
25-
options : {
26-
dateFormat: 'M/d/yy',
25+
options: {
26+
'dateFormat': 'M/d/yy',
2727
'storeLocale': 'en_US',
2828
'timeFormat': 'h:mm: a'
2929
},
30-
storage:ko.observable(moment().format('MM/DD/YYYY'))
30+
storage: observable
3131
};
3232

3333
$(document.body).append(element);
3434

35-
ko.applyBindingsToNode(element[0], { datepicker: config });
35+
ko.applyBindingsToNode(element[0], {
36+
datepicker: config
37+
});
3638
});
3739

3840
afterEach(function () {
3941
element.remove();
4042
});
4143

4244
it('writes picked date\'s value to assigned observable', function () {
43-
var todayDate,
44-
momentFormat,
45-
result,
46-
inputFormat;
47-
48-
inputFormat = 'M/d/yy';
45+
var todayDate, momentFormat, result,
46+
inputFormat = 'M/d/yy';
4947

5048
momentFormat = utils.convertToMomentFormat(inputFormat);
49+
todayDate = moment().format(momentFormat);
5150

52-
todayDate = moment().format(momentFormat);
53-
54-
result = $('input:last').val();
51+
element.datepicker('setTimezoneDate').blur().trigger('change');
52+
result = moment(observable()).format(momentFormat);
5553

5654
expect(todayDate).toEqual(result);
5755
});
5856
});
59-
});
57+
});

0 commit comments

Comments
 (0)