summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/basic_fields_tests.js
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2019-08-23 10:35:36 +0000
committerJulien Mougenot <jum@odoo.com>2019-08-26 07:36:28 +0000
commit91ea5a2ca449549ba50f12c4a778421510ef84fc (patch)
tree7507bd4f9cf4ed734b35017bcba198a112716742 /addons/web/static/tests/fields/basic_fields_tests.js
parent496fc0882d6e3b58a09a39a72c282a732eeb3531 (diff)
[REF] web,*: native event dispatching in test utils
*: mail,partner_autocomplete: adapted tests Added a new function to trigger the adequate type of event on an element (native JS event to DOM Nodes and jQuery event to jQuery objects), and refactored the generic event-triggering functions to call this new function.
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
-rw-r--r--addons/web/static/tests/fields/basic_fields_tests.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js
index a67d4e19cbc..112a1c74b7b 100644
--- a/addons/web/static/tests/fields/basic_fields_tests.js
+++ b/addons/web/static/tests/fields/basic_fields_tests.js
@@ -2967,17 +2967,17 @@ QUnit.module('basic_fields', {
// switch to edit mode
await testUtils.form.clickEdit(form);
// open datepicker and select another value
- testUtils.dom.openDatepicker(form.$('.o_datepicker'));
- testUtils.dom.click($('.bootstrap-datetimepicker-widget .picker-switch').first());
- testUtils.dom.click($('.bootstrap-datetimepicker-widget .picker-switch:eq(1)'));
- testUtils.dom.click($('.bootstrap-datetimepicker-widget .year').eq(11));
- testUtils.dom.click($('.bootstrap-datetimepicker-widget .month').eq(11));
- testUtils.dom.click($('.day:contains(31)'));
+ await testUtils.dom.openDatepicker(form.$('.o_datepicker'));
+ await testUtils.dom.click($('.bootstrap-datetimepicker-widget .picker-switch').first());
+ await testUtils.dom.click($('.bootstrap-datetimepicker-widget .picker-switch:eq(1)'));
+ await testUtils.dom.click($('.bootstrap-datetimepicker-widget .year').eq(11));
+ await testUtils.dom.click($('.bootstrap-datetimepicker-widget .month').eq(11));
+ await testUtils.dom.click($('.day:contains(31)'));
var $warn = form.$('.o_datepicker_warning:visible');
assert.strictEqual($warn.length, 1, "should have a warning in the form view");
- testUtils.fields.editSelect(form.$('.o_field_widget[name=date] input'), ''); // remove the value
+ await testUtils.fields.editSelect(form.$('.o_field_widget[name=date] input'), ''); // remove the value
$warn = form.$('.o_datepicker_warning:visible');
assert.strictEqual($warn.length, 0, "the warning in the form view should be hidden");
@@ -3100,7 +3100,7 @@ QUnit.module('basic_fields', {
assert.strictEqual(form.$('.o_datepicker_input').val(), '02/03/2017',
'the date should be correct in edit mode');
- testUtils.fields.editAndTrigger(form.$('.o_datepicker_input'), '', ['input', 'change', 'focusout']);
+ await testUtils.fields.editAndTrigger(form.$('.o_datepicker_input'), '', ['input', 'change', 'focusout']);
assert.strictEqual(form.$('.o_datepicker_input').val(), '',
'should have correctly removed the value');