diff options
| author | Mohammed Shekha <msh@odoo.com> | 2020-08-18 07:22:47 +0000 |
|---|---|---|
| committer | Lucas Perais (lpe) <lpe@odoo.com> | 2020-09-01 11:43:50 +0000 |
| commit | 2eaf49bb05f9278ee9709d0dec130b4c651bfcba (patch) | |
| tree | f73b6f61a12ff5e43247bb804d2abf467f924418 /addons/web/static/tests/views | |
| parent | 00693dc0b36bebb6b04ef8e81291486334dd4dba (diff) | |
[FIX] web: do not display nocontent help if empty
Have an action which help field has the value:
```
<p></p>
```
Display an empty list or kanban
Before this commit, the nocontent helper was displayed even though there was
nothing to display.
After this commit, an empty html tag is the same as an empty string,
so the helper is not displayed.
task-2320318
closes odoo/odoo#56875
X-original-commit: 3d6bdc5b01a4a94de9baa9bae230e6b34f38dbc9
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Diffstat (limited to 'addons/web/static/tests/views')
| -rw-r--r-- | addons/web/static/tests/views/list_tests.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/addons/web/static/tests/views/list_tests.js b/addons/web/static/tests/views/list_tests.js index 9a7bb44fb26..a0cd91774ce 100644 --- a/addons/web/static/tests/views/list_tests.js +++ b/addons/web/static/tests/views/list_tests.js @@ -4483,6 +4483,30 @@ QUnit.module('Views', { assert.doesNotHaveClass(list, 'o_view_sample_data'); assert.containsNone(list, '.o_list_table'); assert.containsOnce(list, '.o_nocontent_help'); + list.destroy(); + }); + + QUnit.test('Do not display nocontent when it is an empty html tag', async function (assert) { + assert.expect(2); + + this.data.foo.records = []; + + var list = await createView({ + View: ListView, + model: 'foo', + data: this.data, + arch: '<tree><field name="foo"/></tree>', + viewOptions: { + action: { + help: '<p class="hello"></p>' + } + }, + }); + + assert.containsNone(list, '.o_view_nocontent', + "should not display the no content helper"); + + assert.containsOnce(list, 'table', "should have a table in the dom"); list.destroy(); }); |
