From 53d8d38f93d59ae5ca23046d20d1b33bfd1e8838 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 9 Mar 2017 15:13:44 +0100 Subject: [PATCH] [IMP] web: test readonly attr on list field's node This works since a recent commit, which wasn't designed to solve this issue, as we weren't aware of it. --- addons/web/static/test/views/list_tests.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/web/static/test/views/list_tests.js b/addons/web/static/test/views/list_tests.js index 9b04573ed23..c6215f48a18 100644 --- a/addons/web/static/test/views/list_tests.js +++ b/addons/web/static/test/views/list_tests.js @@ -245,7 +245,7 @@ QUnit.module('Views', { }); QUnit.test('editable list view: readonly fields cannot be edited', function (assert) { - assert.expect(2); + assert.expect(3); this.data.foo.fields.foo.readonly = true; @@ -253,13 +253,19 @@ QUnit.module('Views', { View: ListView, model: 'foo', data: this.data, - arch: '', + arch: '' + + '' + + '' + + '' + + '', }); var $td = list.$('td:not(.o_list_record_selector)').first(); var $second_td = list.$('td:not(.o_list_record_selector)').eq(1); + var $third_td = list.$('td:not(.o_list_record_selector)').eq(2); $td.click(); assert.ok(!$td.hasClass('o_edit_mode'), "foo cells should not be editable"); assert.ok($second_td.hasClass('o_edit_mode'), "bar cells should be editable"); + assert.ok(!$third_td.hasClass('o_edit_mode'), "int_field cells should not be editable"); list.destroy(); });