summaryrefslogtreecommitdiff
path: root/addons/web/static/tests
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2019-07-12 09:25:16 +0000
committerJulien Mougenot <jum@odoo.com>2019-08-16 09:03:49 +0000
commitbec84c10a1f683f9cc37e76d7fb354ed066508f4 (patch)
tree67b7805df8ea10e14fb52dd8c69c2e61bbbd7063 /addons/web/static/tests
parent0aea29da8db6821a021a705c68985d7d38d476b1 (diff)
[IMP] web: keyboard navigation between searchbar and renderer
This change allows direct keyboard navigation between the current action searchbar and renderer. Focus can now be toggled using DOWN arrow when focusing the searchbar or the UP arrow when focusing the top cell/record of a kanban or a list.
Diffstat (limited to 'addons/web/static/tests')
-rw-r--r--addons/web/static/tests/views/list_tests.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/addons/web/static/tests/views/list_tests.js b/addons/web/static/tests/views/list_tests.js
index 4c1ff4c10ae..48c0502b689 100644
--- a/addons/web/static/tests/views/list_tests.js
+++ b/addons/web/static/tests/views/list_tests.js
@@ -5883,14 +5883,15 @@ QUnit.module('Views', {
},
});
- assert.ok(document.activeElement.classList.contains('o_searchview_input'), 'default focus should be in search view');
- // switch focus to the create button in tests while it works on live
- $('.o_list_button_add').focus();
- assert.ok(document.activeElement.classList.contains('o_list_button_add'),
- 'focus should now be in create button');
+ assert.ok(document.activeElement.classList.contains('o_searchview_input'),
+ 'default focus should be in search view');
await testUtils.fields.triggerKeydown($(document.activeElement), 'down');
assert.strictEqual(document.activeElement.tagName, 'INPUT',
'focus should now be on the record selector');
+ await testUtils.fields.triggerKeydown($(document.activeElement), 'up');
+ assert.ok(document.activeElement.classList.contains('o_searchview_input'),
+ 'focus should have come back to the search view');
+ await testUtils.fields.triggerKeydown($(document.activeElement), 'down');
await testUtils.fields.triggerKeydown($(document.activeElement), 'down');
assert.strictEqual(document.activeElement.tagName, 'INPUT',
'focus should now be in first row input');