Skip to content

Commit 43f7ce7

Browse files
committed
Merge remote-tracking branch 'mpi/MAGETWO-62856' into place_order
2 parents 87eda04 + 09fd733 commit 43f7ce7

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed
Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright © 2016 Magento. All rights reserved.
2+
* Copyright © 2017 Magento. All rights reserved.
33
* See COPYING.txt for license details.
44
*/
55

@@ -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 : {
25+
options: {
2626
dateFormat: 'M/d/yy',
27-
'storeLocale': 'en_US',
28-
'timeFormat': 'h:mm: a'
27+
storeLocale: 'en_US',
28+
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)