From 73e2cf08a47438788b548ff616c2f6f4922d8ca4 Mon Sep 17 00:00:00 2001 From: luvi Date: Mon, 5 Sep 2022 11:01:35 +0000 Subject: [PATCH] [FIX] web: displays the right status on hover This commit fixes the StateSelection field, which displayed the wrong value on hover. In legacy, the title attribute was set to display that value. Now, it has been replaced by a tooltip, since it can be used with touch and is more convenient to use. A test has been modified to assert the presence of the data-tooltip attribute. closes odoo/odoo#99561 Signed-off-by: Simon Genin (ges@odoo) --- .../views/fields/state_selection/state_selection_field.xml | 2 +- .../static/tests/views/fields/state_selection_field_tests.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/views/fields/state_selection/state_selection_field.xml b/addons/web/static/src/views/fields/state_selection/state_selection_field.xml index 7d5d25a85dd..32c6afee576 100644 --- a/addons/web/static/src/views/fields/state_selection/state_selection_field.xml +++ b/addons/web/static/src/views/fields/state_selection/state_selection_field.xml @@ -9,7 +9,7 @@ - +
diff --git a/addons/web/static/tests/views/fields/state_selection_field_tests.js b/addons/web/static/tests/views/fields/state_selection_field_tests.js index 93cea9f1a4a..bccf0236844 100644 --- a/addons/web/static/tests/views/fields/state_selection_field_tests.js +++ b/addons/web/static/tests/views/fields/state_selection_field_tests.js @@ -87,6 +87,11 @@ QUnit.module("Fields", (hooks) => { "should not have one green status since selection is the second, blocked state" ); assert.containsNone(target, ".dropdown-menu", "there should not be a dropdown"); + assert.strictEqual( + target.querySelector(".o_field_state_selection .dropdown-toggle").dataset.tooltip, + "Blocked", + "tooltip attribute has the right text" + ); // Click on the status button to make the dropdown appear await click(target, ".o_field_widget.o_field_state_selection .o_status");