diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-10-11 16:29:46 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-10-11 16:29:46 +0200 |
| commit | 1ade6675c37e463e67fe958e1c0b79f24c97e281 (patch) | |
| tree | 739750e52a76d20f90ab7c65877386a05ca0969f /addons/web/static/tests/fields/basic_fields_tests.js | |
| parent | 32b19115e9d7470531f3218b39e8773ba5361bba (diff) | |
| parent | 717f4583949219c346c87c390fbc336b4f31571c (diff) | |
[MERGE] forward port branch 11.0 up to 717f4583949
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/basic_fields_tests.js | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index 03f9a3606af..4b1e6248624 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -2226,7 +2226,7 @@ QUnit.module('basic_fields', { }); QUnit.test('date field value should not set on first click', function (assert) { - assert.expect(2); + assert.expect(3); var form = createView({ View: FormView, @@ -2236,10 +2236,10 @@ QUnit.module('basic_fields', { res_id: 4, }); form.$buttons.find('.o_form_button_edit').click(); - form.$('.o_datepicker_input').click(); + assert.strictEqual($('.bootstrap-datetimepicker-widget').length, 1, "there should be a datepicker (autofocus)"); assert.strictEqual(form.$('.o_datepicker_input').val(), '', "date field's input should be empty on first click"); $('.day:contains(22)').click(); - form.$('.o_datepicker_input').click(); // Open Datepicker second time + form.$('.o_datepicker_input').focus(); // Open Datepicker second time assert.strictEqual($('.day.active').text(), '22', 'datepicker should be highlight with 22nd day of month'); form.destroy(); }); @@ -2277,8 +2277,7 @@ QUnit.module('basic_fields', { assert.strictEqual(form.$('.o_datepicker_input').val(), '02/03/2017', 'the date should be correct in edit mode'); - // click on the input and select another value - form.$('.o_datepicker_input').click(); + // select another value assert.ok($('.bootstrap-datetimepicker-widget').length, 'datepicker should be open'); assert.strictEqual($('.day.active').data('day'), '02/03/2017', 'datepicker should be highlight February 3'); $('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Month selection @@ -2361,8 +2360,7 @@ QUnit.module('basic_fields', { assert.strictEqual(list.$('input.o_datepicker_input').val(), '02/03/2017', 'the date should be correct in edit mode'); - // click on the input and select another value - list.$('input.o_datepicker_input').click(); + // select another value assert.ok($('.bootstrap-datetimepicker-widget').length, 'datepicker should be open'); $('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Month selection $('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Year selection @@ -2479,8 +2477,7 @@ QUnit.module('basic_fields', { form.$buttons.find('.o_form_button_edit').click(); assert.strictEqual(form.$('.o_datepicker_input').val(), expectedDateString, 'the datetime should be correct in edit mode'); - // click on the input and select 22 February at 8:23:33 - form.$('.o_datepicker_input').click(); + // select 22 February at 8:23:33 assert.ok($('.bootstrap-datetimepicker-widget').length, 'datepicker should be open'); $('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Month selection $('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Year selection @@ -2578,8 +2575,7 @@ QUnit.module('basic_fields', { assert.strictEqual(list.$('input.o_datepicker_input').val(), expectedDateString, 'the date should be correct in edit mode'); - // click on the input and select 22 February at 8:23:33 - list.$('input.o_datepicker_input').click(); + // select 22 February at 8:23:33 assert.ok($('.bootstrap-datetimepicker-widget').length, 'datepicker should be open'); $('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Month selection $('.bootstrap-datetimepicker-widget .picker-switch').first().click(); // Year selection @@ -2755,7 +2751,6 @@ QUnit.module('basic_fields', { }); form.$buttons.find('.o_form_button_create').click(); - form.$('.o_datepicker_input.o_input').click(); assert.ok($('.day:last-child(),.day:nth-child(2)').hasClass('disabled'), 'first and last days must be disabled'); assert.notOk($('.day:not(:last-child()):not(:nth-child(2))').hasClass('disabled'), |
