summaryrefslogtreecommitdiff
path: root/addons/web/static/tests
diff options
context:
space:
mode:
authorDavid Monjoie <dmo@odoo.com>2019-05-29 13:24:33 +0000
committerDavid Monjoie <dmo@odoo.com>2019-06-04 07:04:50 +0000
commit88a26235ca97e2901e5969df03adaf4d023452d3 (patch)
treef995b9de0221c89f65d81d9d3119f530a1c25e13 /addons/web/static/tests
parent2bffd654518a72ecc4c9df07f9565e4789f4b195 (diff)
[IMP] web: add optional fields parameter
This commit adds a new parameter on fields for list view and one2many. The parameter name is "optional" and its values are "hide" or "show". Columns of the list view which have the optional parameter set are listed in a dropdown that can be toggled from the last cell of the table header. The ones with optional set to "hide" are hidden by default. User choice is stored in local storage. If no saved parameter can be found in local storage then the default value from the view is used. Due to the overflow behavior of the responsive table, we were forced to wrap the table-responsive div in yet another div. We changed the o_list_view class on the table to o_list_table in order to reuse the more generic o_list_view class on the top-most div. CSS rules and selectors had to be updated according to this change. Task-1902765
Diffstat (limited to 'addons/web/static/tests')
-rw-r--r--addons/web/static/tests/chrome/action_manager_tests.js8
-rw-r--r--addons/web/static/tests/fields/relational_fields_tests.js77
-rw-r--r--addons/web/static/tests/views/form_tests.js16
-rw-r--r--addons/web/static/tests/views/list_tests.js300
-rw-r--r--addons/web/static/tests/views/view_dialogs_tests.js2
5 files changed, 389 insertions, 14 deletions
diff --git a/addons/web/static/tests/chrome/action_manager_tests.js b/addons/web/static/tests/chrome/action_manager_tests.js
index b14ccefb447..7ac817af30c 100644
--- a/addons/web/static/tests/chrome/action_manager_tests.js
+++ b/addons/web/static/tests/chrome/action_manager_tests.js
@@ -2889,7 +2889,7 @@ QUnit.module('ActionManager', {
});
await actionManager.doAction(3);
- assert.doesNotHaveClass(actionManager.$('.o_list_view'), 'o_list_view_grouped',
+ assert.doesNotHaveClass(actionManager.$('.o_list_table'), 'o_list_table_grouped',
"list view is not grouped");
// open group by dropdown
@@ -2898,7 +2898,7 @@ QUnit.module('ActionManager', {
// click on first link
await testUtils.dom.click($('.o_control_panel .o_group_by_menu a:first'));
- assert.hasClass(actionManager.$('.o_list_view'),'o_list_view_grouped',
+ assert.hasClass(actionManager.$('.o_list_table'),'o_list_table_grouped',
'list view is now grouped');
actionManager.destroy();
@@ -3110,7 +3110,7 @@ QUnit.module('ActionManager', {
});
await actionManager.doAction(3);
- assert.containsOnce(actionManager, '.o_list_view_grouped',
+ assert.containsOnce(actionManager, '.o_list_table_grouped',
"should be grouped");
assert.containsN(actionManager, '.o_group_header', 2,
"should be grouped by 'bar' (two groups) at first load");
@@ -3125,7 +3125,7 @@ QUnit.module('ActionManager', {
// remove the groupby in the searchview
await testUtils.dom.click($('.o_control_panel .o_searchview .o_facet_remove'));
- assert.containsOnce(actionManager, '.o_list_view_grouped',
+ assert.containsOnce(actionManager, '.o_list_table_grouped',
"should still be grouped");
assert.containsN(actionManager, '.o_group_header', 2,
"should be grouped by 'bar' (two groups) at reload");
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js
index 6f72b827cae..aec23c150bc 100644
--- a/addons/web/static/tests/fields/relational_fields_tests.js
+++ b/addons/web/static/tests/fields/relational_fields_tests.js
@@ -1,8 +1,10 @@
odoo.define('web.relational_fields_tests', function (require) {
"use strict";
+var AbstractStorageService = require('web.AbstractStorageService');
var FormView = require('web.FormView');
var ListView = require('web.ListView');
+var RamStorage = require('web.RamStorage');
var relationalFields = require('web.relational_fields');
var testUtils = require('web.test_utils');
@@ -2888,6 +2890,81 @@ QUnit.module('relational_fields', {
form.destroy();
});
+ QUnit.test('one2many field in edit mode with optional fields and trash icon', async function (assert) {
+ assert.expect(13);
+
+ var RamStorageService = AbstractStorageService.extend({
+ storage: new RamStorage(),
+ });
+
+ this.data.partner.records[0].p = [2];
+ var form = await createView({
+ View: FormView,
+ model: 'partner',
+ data: this.data,
+ arch: '<form string="Partners">' +
+ '<field name="p"/>' +
+ '</form>',
+ res_id: 1,
+ archs: {
+ 'partner,false,list': '<tree editable="top">' +
+ '<field name="foo" optional="show"/>' +
+ '<field name="bar" optional="hide"/>' +
+ '</tree>',
+ },
+ services: {
+ local_storage: RamStorageService,
+ },
+ });
+
+ // should have 2 columns 1 for foo and 1 for advanced dropdown
+ assert.containsN(form.$('.o_field_one2many'), 'th', 1,
+ "should be 1 th in the one2many in readonly mode");
+ assert.containsOnce(form.$('.o_field_one2many table'), '.o_optional_columns_dropdown_toggle',
+ "should have the optional columns dropdown toggle inside the table");
+ await testUtils.form.clickEdit(form);
+ // should have 2 columns 1 for foo and 1 for trash icon, dropdown is displayed
+ // on trash icon cell, no separate cell created for trash icon and advanced field dropdown
+ assert.containsN(form.$('.o_field_one2many'), 'th', 2,
+ "should be 2 th in the one2many edit mode");
+ assert.containsN(form.$('.o_field_one2many'), '.o_data_row:first > td', 2,
+ "should be 2 cells in the one2many in edit mode");
+
+ await testUtils.dom.click(form.$('.o_field_one2many table .o_optional_columns_dropdown_toggle'));
+ assert.containsN(form.$('.o_field_one2many'), 'div.o_optional_columns div.dropdown-item:visible', 2,
+ "dropdown have 2 advanced field foo with checked and bar with unchecked");
+ await testUtils.dom.click(form.$('div.o_optional_columns div.dropdown-item:eq(1) input'));
+ assert.containsN(form.$('.o_field_one2many'), 'th', 3,
+ "should be 3 th in the one2many after enabling bar column from advanced dropdown");
+
+ await testUtils.dom.click(form.$('div.o_optional_columns div.dropdown-item:first input'));
+ assert.containsN(form.$('.o_field_one2many'), 'th', 2,
+ "should be 2 th in the one2many after disabling foo column from advanced dropdown");
+
+ assert.containsN(form.$('.o_field_one2many'), 'div.o_optional_columns div.dropdown-item:visible', 2,
+ "dropdown is still open");
+ await testUtils.dom.click(form.$('.o_field_x2many_list_row_add a'));
+ assert.containsN(form.$('.o_field_one2many'), 'div.o_optional_columns div.dropdown-item:visible', 0,
+ "dropdown is closed");
+ var $selectedRow = form.$('.o_field_one2many tr.o_selected_row');
+ assert.strictEqual($selectedRow.length, 1, "should have selected row i.e. edition mode");
+
+ await testUtils.dom.click(form.$('.o_field_one2many table .o_optional_columns_dropdown_toggle'));
+ await testUtils.dom.click(form.$('div.o_optional_columns div.dropdown-item:first input'));
+ $selectedRow = form.$('.o_field_one2many tr.o_selected_row');
+ assert.strictEqual($selectedRow.length, 0,
+ "current edition mode discarded when selecting advanced field");
+ assert.containsN(form.$('.o_field_one2many'), 'th', 3,
+ "should be 3 th in the one2many after re-enabling foo column from advanced dropdown");
+
+ // check after form reload advanced column hidden or shown are still preserved
+ await form.reload();
+ assert.containsN(form.$('.o_field_one2many .o_list_view'), 'th', 3,
+ "should still have 3 th in the one2many after reloading whole form view");
+
+ form.destroy();
+ });
+
QUnit.module('TabNavigation');
QUnit.test('when Navigating to a many2one with tabs, it receives the focus and adds a new line', async function (assert) {
assert.expect(3);
diff --git a/addons/web/static/tests/views/form_tests.js b/addons/web/static/tests/views/form_tests.js
index 02121d01c5e..7a357d9b345 100644
--- a/addons/web/static/tests/views/form_tests.js
+++ b/addons/web/static/tests/views/form_tests.js
@@ -245,18 +245,18 @@ QUnit.module('Views', {
});
assert.containsOnce(form, 'div.o_field_one2many:eq(0):not(.o_readonly_modifier)', "first one2many widget should not be readonly");
assert.hasClass(form.$('div.o_field_one2many:eq(1)'),'o_readonly_modifier', "second one2many widget should be readonly");
- await testUtils.dom.click(form.$('div.tab-content table.o_list_view:eq(0) tr.o_data_row td.o_data_cell:eq(0)'));
- assert.strictEqual(form.$('div.tab-content table.o_list_view tr.o_selected_row input[name="foo"]').val(), "yop",
+ await testUtils.dom.click(form.$('div.tab-content table.o_list_table:eq(0) tr.o_data_row td.o_data_cell:eq(0)'));
+ assert.strictEqual(form.$('div.tab-content table.o_list_table tr.o_selected_row input[name="foo"]').val(), "yop",
"first line in one2many of first tab contains yop");
- assert.strictEqual(form.$('div.tab-content table.o_list_view:eq(1) tr.o_data_row td.o_data_cell:eq(0)').text(),
+ assert.strictEqual(form.$('div.tab-content table.o_list_table:eq(1) tr.o_data_row td.o_data_cell:eq(0)').text(),
"yop", "first line in one2many of second tab contains yop");
- await testUtils.fields.editInput(form.$('div.tab-content table.o_list_view tr.o_selected_row input[name="foo"]'), "hello");
- assert.strictEqual(form.$('div.tab-content table.o_list_view:eq(1) tr.o_data_row td.o_data_cell:eq(0)').text(), "hello",
+ await testUtils.fields.editInput(form.$('div.tab-content table.o_list_table tr.o_selected_row input[name="foo"]'), "hello");
+ assert.strictEqual(form.$('div.tab-content table.o_list_table:eq(1) tr.o_data_row td.o_data_cell:eq(0)').text(), "hello",
"first line in one2many of second tab contains hello");
- await testUtils.dom.click(form.$('div.tab-content table.o_list_view:eq(0) a:contains(Add a line)'));
- assert.strictEqual(form.$('div.tab-content table.o_list_view tr.o_selected_row input[name="foo"]').val(), "My little Foo Value",
+ await testUtils.dom.click(form.$('div.tab-content table.o_list_table:eq(0) a:contains(Add a line)'));
+ assert.strictEqual(form.$('div.tab-content table.o_list_table tr.o_selected_row input[name="foo"]').val(), "My little Foo Value",
"second line in one2many of first tab contains 'My little Foo Value'");
- assert.strictEqual(form.$('div.tab-content table.o_list_view:eq(1) tr.o_data_row:eq(1) td.o_data_cell:eq(0)').text(),
+ assert.strictEqual(form.$('div.tab-content table.o_list_table:eq(1) tr.o_data_row:eq(1) td.o_data_cell:eq(0)').text(),
"My little Foo Value", "first line in one2many of second tab contains hello");
form.destroy();
});
diff --git a/addons/web/static/tests/views/list_tests.js b/addons/web/static/tests/views/list_tests.js
index bbc6cf763cf..fa62c6f3a25 100644
--- a/addons/web/static/tests/views/list_tests.js
+++ b/addons/web/static/tests/views/list_tests.js
@@ -1,6 +1,7 @@
odoo.define('web.list_tests', function (require) {
"use strict";
+var AbstractStorageService = require('web.AbstractStorageService');
var BasicModel = require('web.BasicModel');
var config = require('web.config');
var core = require('web.core');
@@ -9,6 +10,7 @@ var FormView = require('web.FormView');
var ListView = require('web.ListView');
var mixins = require('web.mixins');
var NotificationService = require('web.NotificationService');
+var RamStorage = require('web.RamStorage');
var testUtils = require('web.test_utils');
var widgetRegistry = require('web.widget_registry');
var Widget = require('web.Widget');
@@ -2295,7 +2297,7 @@ QUnit.module('Views', {
});
await testUtils.dom.click(list.$buttons.find('.o_list_button_add'));
- await testUtils.dom.click(list.$('div.table-responsive'));
+ await testUtils.dom.click(list.$('.o_list_view'));
assert.strictEqual(createCount, 1, "should have created a record");
@@ -6134,6 +6136,302 @@ QUnit.module('Views', {
list.destroy();
});
+ QUnit.test('list view with optional fields rendering', async function (assert) {
+ assert.expect(9);
+
+ var RamStorageService = AbstractStorageService.extend({
+ storage: new RamStorage(),
+ });
+
+ var list = await createView({
+ View: ListView,
+ model: 'foo',
+ data: this.data,
+ arch: '<tree>' +
+ '<field name="foo"/>' +
+ '<field name="m2o" optional="hide"/>' +
+ '<field name="amount"/>' +
+ '<field name="reference" optional="hide"/>' +
+ '</tree>',
+ services: {
+ local_storage: RamStorageService,
+ },
+ });
+
+ assert.containsN(list, 'th', 3,
+ "should have 3 th, 1 for selector, 2 for columns");
+
+ assert.containsOnce(list.$('table'), '.o_optional_columns_dropdown_toggle',
+ "should have the optional columns dropdown toggle inside the table");
+
+ // optional fields
+ await testUtils.dom.click(list.$('table .o_optional_columns_dropdown_toggle'));
+ assert.containsN(list, 'div.o_optional_columns div.dropdown-item', 2,
+ "dropdown have 2 optional field foo with checked and bar with unchecked");
+
+ // enable optional field
+ await testUtils.dom.click(list.$('div.o_optional_columns div.dropdown-item:first input'));
+ // 5 th (1 for checkbox, 4 for columns)
+ assert.containsN(list, 'th', 4, "should have 4 th");
+ assert.ok(list.$('th:contains(M2O field)').is(':visible'),
+ "should have a visible m2o field"); //m2o field
+
+ // disable optional field
+ await testUtils.dom.click(list.$('table .o_optional_columns_dropdown_toggle'));
+ assert.strictEqual(list.$('div.o_optional_columns div.dropdown-item:first input:checked')[0],
+ list.$('div.o_optional_columns div.dropdown-item [name="m2o"]')[0],
+ "m2o advanced field check box should be checked in dropdown");
+
+ await testUtils.dom.click(list.$('div.o_optional_columns div.dropdown-item:first input'));
+ // 3 th (1 for checkbox, 2 for columns)
+ assert.containsN(list, 'th', 3, "should have 3 th");
+ assert.notOk(list.$('th:contains(M2O field)').is(':visible'),
+ "should not have a visible m2o field"); //m2o field not displayed
+
+ await testUtils.dom.click(list.$('table .o_optional_columns_dropdown_toggle'));
+ assert.notOk(list.$('div.o_optional_columns div.dropdown-item [name="m2o"]').is(":checked"));
+
+ list.destroy();
+ });
+
+ QUnit.test('optinal fields do not disappear even after listview reload', async function (assert) {
+ assert.expect(7);
+
+ var RamStorageService = AbstractStorageService.extend({
+ storage: new RamStorage(),
+ });
+
+ var list = await createView({
+ View: ListView,
+ model: 'foo',
+ data: this.data,
+ arch: '<tree>' +
+ '<field name="foo"/>' +
+ '<field name="m2o" optional="hide"/>' +
+ '<field name="amount"/>' +
+ '<field name="reference" optional="hide"/>' +
+ '</tree>',
+ services: {
+ local_storage: RamStorageService,
+ },
+ });
+
+ assert.containsN(list, 'th', 3,
+ "should have 3 th, 1 for selector, 2 for columns");
+
+ // enable optional field
+ await testUtils.dom.click(list.$('table .o_optional_columns_dropdown_toggle'));
+ assert.notOk(list.$('div.o_optional_columns div.dropdown-item [name="m2o"]').is(":checked"));
+ await testUtils.dom.click(list.$('div.o_optional_columns div.dropdown-item:first input'));
+ assert.containsN(list, 'th', 4,
+ "should have 4 th 1 for selector, 3 for columns");
+ assert.ok(list.$('th:contains(M2O field)').is(':visible'),
+ "should have a visible m2o field"); //m2o field
+
+ // reload listview
+ await list.reload();
+ assert.containsN(list, 'th', 4,
+ "should have 4 th 1 for selector, 3 for columns ever after listview reload");
+ assert.ok(list.$('th:contains(M2O field)').is(':visible'),
+ "should have a visible m2o field even after listview reload");
+
+ await testUtils.dom.click(list.$('table .o_optional_columns_dropdown_toggle'));
+ assert.ok(list.$('div.o_optional_columns div.dropdown-item [name="m2o"]').is(":checked"));
+
+ list.destroy();
+ });
+
+ QUnit.test('change the viewType of the current action', async function (assert) {
+ assert.expect(25);
+
+ this.actions = [{
+ id: 1,
+ name: 'Partners Action 1',
+ res_model: 'foo',
+ type: 'ir.actions.act_window',
+ views: [[1, 'kanban']],
+ }, {
+ id: 2,
+ name: 'Partners',
+ res_model: 'foo',
+ type: 'ir.actions.act_window',
+ views: [[false, 'list'], [1, 'kanban']],
+ }];
+
+ this.archs = {
+ 'foo,1,kanban': '<kanban><templates><t t-name="kanban-box">' +
+ '<div class="oe_kanban_global_click"><field name="foo"/></div>' +
+ '</t></templates></kanban>',
+
+ 'foo,false,list': '<tree limit="3">' +
+ '<field name="foo"/>' +
+ '<field name="m2o" optional="hide"/>' +
+ '<field name="o2m" optional="show"/></tree>',
+
+ 'foo,false,search': '<search><field name="foo" string="Foo"/></search>',
+ };
+
+ var RamStorageService = AbstractStorageService.extend({
+ storage: new RamStorage(),
+ });
+
+ var actionManager = await testUtils.createActionManager({
+ actions: this.actions,
+ archs: this.archs,
+ data: this.data,
+ services: {
+ local_storage: RamStorageService,
+ },
+ });
+ await actionManager.doAction(2);
+
+ assert.containsOnce(actionManager, '.o_list_view',
+ "should have rendered a list view");
+
+ assert.containsN(actionManager, 'th', 3, "should display 3 th (selector + 2 fields)");
+
+ // enable optional field
+ await testUtils.dom.click(actionManager.$('table .o_optional_columns_dropdown_toggle'));
+ assert.notOk(actionManager.$('div.o_optional_columns div.dropdown-item [name="m2o"]').is(":checked"));
+ assert.ok(actionManager.$('div.o_optional_columns div.dropdown-item [name="o2m"]').is(":checked"));
+ await testUtils.dom.click(actionManager.$('div.o_optional_columns div.dropdown-item:first'));
+ assert.containsN(actionManager, 'th', 4, "should display 4 th (selector + 3 fields)");
+ assert.ok(actionManager.$('th:contains(M2O field)').is(':visible'),
+ "should have a visible m2o field"); //m2o field
+
+ // switch to kanban view
+ await actionManager.loadState({
+ action: 2,
+ view_type: 'kanban',
+ });
+
+ assert.containsNone(actionManager, '.o_list_view',
+ "should not display the list view anymore");
+ assert.containsOnce(actionManager, '.o_kanban_view',
+ "should have switched to the kanban view");
+
+ // switch back to list view
+ await actionManager.loadState({
+ action: 2,
+ view_type: 'list',
+ });
+
+ assert.containsNone(actionManager, '.o_kanban_view',
+ "should not display the kanban view anymoe");
+ assert.containsOnce(actionManager, '.o_list_view',
+ "should display the list view");
+
+ assert.containsN(actionManager, 'th', 4, "should display 4 th");
+ assert.ok(actionManager.$('th:contains(M2O field)').is(':visible'),
+ "should have a visible m2o field"); //m2o field
+ assert.ok(actionManager.$('th:contains(O2M field)').is(':visible'),
+ "should have a visible o2m field"); //m2o field
+
+ // disable optional field
+ await testUtils.dom.click(actionManager.$('table .o_optional_columns_dropdown_toggle'));
+ assert.ok(actionManager.$('div.o_optional_columns div.dropdown-item [name="m2o"]').is(":checked"));
+ assert.ok(actionManager.$('div.o_optional_columns div.dropdown-item [name="o2m"]').is(":checked"));
+ await testUtils.dom.click(actionManager.$('div.o_optional_columns div.dropdown-item:last input'));
+ assert.ok(actionManager.$('th:contains(M2O field)').is(':visible'),
+ "should have a visible m2o field"); //m2o field
+ assert.notOk(actionManager.$('th:contains(O2M field)').is(':visible'),
+ "should have a visible o2m field"); //m2o field
+ assert.containsN(actionManager, 'th', 3, "should display 3 th");
+
+ await actionManager.doAction(1);
+
+ assert.containsNone(actionManager, '.o_list_view',
+ "should not display the list view anymore");
+ assert.containsOnce(actionManager, '.o_kanban_view',
+ "should have switched to the kanban view");
+
+ await actionManager.doAction(2);
+
+ assert.containsNone(actionManager, '.o_kanban_view',
+ "should not havethe kanban view anymoe");
+ assert.containsOnce(actionManager, '.o_list_view',
+ "should display the list view");
+
+ assert.containsN(actionManager, 'th', 3, "should display 3 th");
+ assert.ok(actionManager.$('th:contains(M2O field)').is(':visible'),
+ "should have a visible m2o field"); //m2o field
+ assert.notOk(actionManager.$('th:contains(O2M field)').is(':visible'),
+ "should have a visible o2m field"); //m2o field
+
+ actionManager.destroy();
+ });
+
+ QUnit.test('list view with optional fields rendering and local storage mock', async function (assert) {
+ assert.expect(12);
+
+ var forceLocalStorage = true;
+
+ var Storage = RamStorage.extend({
+ getItem: function (key) {
+ assert.step('getItem ' + key);
+ return forceLocalStorage ? '["m2o"]' : this._super.apply(this, arguments);
+ },
+ setItem: function (key, value) {
+ assert.step('setItem ' + key + ' to ' + value);
+ return this._super.apply(this, arguments);
+ },
+ });
+
+ var RamStorageService = AbstractStorageService.extend({
+ storage: new Storage(),
+ });
+
+ var list = await createView({
+ View: ListView,
+ model: 'foo',
+ data: this.data,
+ arch: '<tree>' +
+ '<field name="foo"/>' +
+ '<field name="m2o" optional="hide"/>' +
+ '<field name="reference" optional="show"/>' +
+ '</tree>',
+ services: {
+ local_storage: RamStorageService,
+ },
+ });
+
+ assert.verifySteps(['getItem list_optional_fields,foo,list,foo:char,m2o:many2one,reference:reference']);
+
+ assert.containsN(list, 'th', 3,
+ "should have 3 th, 1 for selector, 2 for columns");
+
+ assert.ok(list.$('th:contains(M2O field)').is(':visible'),
+ "should have a visible m2o field"); //m2o field
+
+ assert.notOk(list.$('th:contains(Reference Field)').is(':visible'),
+ "should not have a visible reference field");
+
+ // optional fields
+ await testUtils.dom.click(list.$('table .o_optional_columns_dropdown_toggle'));
+ assert.containsN(list, 'div.o_optional_columns div.dropdown-item', 2,
+ "dropdown have 2 optional fields");
+
+ forceLocalStorage = false;
+ // enable optional field
+ await testUtils.dom.click(list.$('div.o_optional_columns div.dropdown-item:eq(1) input'));
+
+ assert.verifySteps([
+ 'setItem list_optional_fields,foo,list,foo:char,m2o:many2one,reference:reference to ["m2o","reference"]',
+ 'getItem list_optional_fields,foo,list,foo:char,m2o:many2one,reference:reference',
+ ]);
+
+ // 4 th (1 for checkbox, 3 for columns)
+ assert.containsN(list, 'th', 4, "should have 4 th");
+
+ assert.ok(list.$('th:contains(M2O field)').is(':visible'),
+ "should have a visible m2o field"); //m2o field
+
+ assert.ok(list.$('th:contains(Reference Field)').is(':visible'),
+ "should have a visible reference field");
+
+ list.destroy();
+ });
+
// TODO: write test on:
// - default_get with a field not in view
});
diff --git a/addons/web/static/tests/views/view_dialogs_tests.js b/addons/web/static/tests/views/view_dialogs_tests.js
index 847bbd0f3be..558caeeaf37 100644
--- a/addons/web/static/tests/views/view_dialogs_tests.js
+++ b/addons/web/static/tests/views/view_dialogs_tests.js
@@ -350,7 +350,7 @@ QUnit.module('Views', {
'There should be two modals');
var $second_modal = $modals.not($modal);
- await testUtils.dom.click($second_modal.find('.o_list_view.table.table-sm.table-striped.o_list_view_ungrouped .o_data_row input[type=checkbox]'));
+ await testUtils.dom.click($second_modal.find('.o_list_table.table.table-sm.table-striped.o_list_table_ungrouped .o_data_row input[type=checkbox]'));
await testUtils.dom.click($second_modal.find('.o_select_button'));