From 3c0190d0a6c0d5ccc130fd9b685681fa9bac1de3 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 23 Feb 2017 14:08:33 +0100 Subject: [IMP] web: use moment object instead of string for date Before this commit, the odoo web client used strings to represent dates. Now, the date is parsed into a moment object when the value is read from the server side. The widget formats the object to display the value. When the widget value changes, the value is parsed to a moment object. The value is automatically formatted to server value in ajax calls (toJSON method). --- addons/web/static/test/fields/basic_fields_tests.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'addons/web/static/test/fields/basic_fields_tests.js') diff --git a/addons/web/static/test/fields/basic_fields_tests.js b/addons/web/static/test/fields/basic_fields_tests.js index 078008ced35..0d03b98e467 100644 --- a/addons/web/static/test/fields/basic_fields_tests.js +++ b/addons/web/static/test/fields/basic_fields_tests.js @@ -519,7 +519,7 @@ QUnit.module('basic_fields', { }); QUnit.test('field date in editable list view', function (assert) { - assert.expect(1); + assert.expect(2); this.data.partner.fields.date.default = "2017-02-10"; this.data.partner.records = []; @@ -535,7 +535,10 @@ QUnit.module('basic_fields', { list.$buttons.find('.o_list_button_add').click(); - assert.ok(list.$('input').is(':focus'), + assert.strictEqual(list.$('input.o_datepicker_input').length, 1, + "the view should have a date input for editable mode"); + + assert.ok(list.$('input.o_datepicker_input').is(':focus'), "date input should have the focus (make sure the test window had the focus)"); }); -- cgit v1.2.3