summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/basic_fields_tests.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
-rw-r--r--addons/web/static/tests/fields/basic_fields_tests.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js
index f176b4e0ab9..32450f3d56b 100644
--- a/addons/web/static/tests/fields/basic_fields_tests.js
+++ b/addons/web/static/tests/fields/basic_fields_tests.js
@@ -4418,6 +4418,27 @@ QUnit.module('basic_fields', {
form.destroy();
});
+ QUnit.test('state_selection widget with readonly modifier', function (assert) {
+ assert.expect(4);
+
+ var form = createView({
+ View: FormView,
+ model: 'partner',
+ data: this.data,
+ arch: '<form><field name="selection" widget="state_selection" readonly="1"/></form>',
+ res_id: 1,
+ });
+
+ assert.hasClass(form.$('.o_selection'), 'o_readonly_modifier');
+ assert.hasClass(form.$('.o_selection > a'), 'disabled');
+ assert.isNotVisible(form.$('.dropdown-menu.state'));
+
+ testUtils.dom.click(form.$('.o_selection > a'));
+ assert.isNotVisible(form.$('.dropdown-menu.state'));
+
+ form.destroy();
+ });
+
QUnit.test('state_selection widget in editable list view', function (assert) {
assert.expect(32);