Skip to content
Snippets Groups Projects
Commit 43f7ce74 authored by Olga Matviienko's avatar Olga Matviienko
Browse files

Merge remote-tracking branch 'mpi/MAGETWO-62856' into place_order

parents 87eda049 09fd7335
Branches
No related merge requests found
/**
* Copyright © 2016 Magento. All rights reserved.
* Copyright © 2017 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
......@@ -18,21 +18,23 @@ define([
config;
beforeEach(function () {
element = $('<input />');
element = $('<input />');
observable = ko.observable();
config = {
options : {
options: {
dateFormat: 'M/d/yy',
'storeLocale': 'en_US',
'timeFormat': 'h:mm: a'
storeLocale: 'en_US',
timeFormat: 'h:mm: a'
},
storage:ko.observable(moment().format('MM/DD/YYYY'))
storage: observable
};
$(document.body).append(element);
ko.applyBindingsToNode(element[0], { datepicker: config });
ko.applyBindingsToNode(element[0], {
datepicker: config
});
});
afterEach(function () {
......@@ -40,20 +42,16 @@ define([
});
it('writes picked date\'s value to assigned observable', function () {
var todayDate,
momentFormat,
result,
inputFormat;
inputFormat = 'M/d/yy';
var todayDate, momentFormat, result,
inputFormat = 'M/d/yy';
momentFormat = utils.convertToMomentFormat(inputFormat);
todayDate = moment().format(momentFormat);
todayDate = moment().format(momentFormat);
result = $('input:last').val();
element.datepicker('setTimezoneDate').blur().trigger('change');
result = moment(observable()).format(momentFormat);
expect(todayDate).toEqual(result);
});
});
});
\ No newline at end of file
});
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment