Skip to content
Permalink
Browse files

[IMP]web: test case for moving down

- down key in listview should work with editable listview

issue: 1880688
  • Loading branch information...
pka-odoo authored and msh-odoo committed Feb 19, 2019
1 parent e77cad5 commit 9e95385743400c7fa120e5421b8dc87376606aaf
Showing with 13 additions and 8 deletions.
  1. +13 −8 addons/web/static/tests/views/list_tests.js
@@ -2890,8 +2890,8 @@ QUnit.module('Views', {
list.destroy();
});

QUnit.test('navigation: not moving down with keydown', function (assert) {
assert.expect(2);
QUnit.test('navigation: moving down with keydown', function (assert) {
assert.expect(3);

var list = createView({
View: ListView,
@@ -2900,12 +2900,17 @@ QUnit.module('Views', {
arch: '<tree editable="bottom"><field name="foo"/></tree>',
});

list.$('td:contains(yop)').click();
assert.ok(list.$('tr.o_data_row:eq(0)').hasClass('o_selected_row'),
"1st row should be selected");
list.$('tr.o_selected_row input[name="foo"]').trigger({type: 'keydown', which: $.ui.keyCode.DOWN});
assert.ok(list.$('tr.o_data_row:eq(0)').hasClass('o_selected_row'),
"1st row should still be selected");
$('.o_list_button_add').trigger({type: 'keydown', which: $.ui.keyCode.DOWN});
assert.strictEqual($(document.activeElement).parents('tr').find('.o_data_cell').text(), 'yop',
"first row(yop) should be focused");

$(document.activeElement).trigger({type: 'keydown', which: $.ui.keyCode.DOWN});
assert.strictEqual($(document.activeElement).parents('tr').find('.o_data_cell').text(), 'blip',
"second row(blip) should be focused");

$(document.activeElement).trigger({type: 'keydown', which: $.ui.keyCode.DOWN});
assert.strictEqual($(document.activeElement).parents('tr').find('.o_data_cell').text(), 'gnap',
"third row(gnap) should be focused");
list.destroy();
});

0 comments on commit 9e95385

Please sign in to comment.
You can’t perform that action at this time.