diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-08-21 16:58:17 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-08-21 16:58:17 +0200 |
| commit | 70d0148d0da1ccf3727310d8e7c53e2c518a8d6a (patch) | |
| tree | 00c4884eca26b424989619b778d6ce9216e9493b /addons/document/static/tests | |
| parent | c8762eaa03cc9dda4c7318251726af1b83a2c10f (diff) | |
| parent | fbfb91799eecc5297ab6c86b657bf213343f6cd8 (diff) | |
[MERGE] forward port branch 11.0 up to fbfb91799ee
Diffstat (limited to 'addons/document/static/tests')
| -rw-r--r-- | addons/document/static/tests/document_tests.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/addons/document/static/tests/document_tests.js b/addons/document/static/tests/document_tests.js index 338f3e75581..96c699c041b 100644 --- a/addons/document/static/tests/document_tests.js +++ b/addons/document/static/tests/document_tests.js @@ -3,6 +3,7 @@ odoo.define('document.tests', function (require) { var testUtils = require('web.test_utils'); var FormView = require('web.FormView'); + var ListView = require('web.ListView'); var createView = testUtils.createView; @@ -16,6 +17,9 @@ odoo.define('document.tests', function (require) { records: [{ id: 1, display_name: "first record", + }, { + id: 2, + display_name: "second record", }] }, 'ir.attachment': { @@ -74,5 +78,34 @@ odoo.define('document.tests', function (require) { assert.strictEqual(form.sidebar.$('.o_sidebar_delete_attachment').length, 1, "there should be only one attachment"); form.destroy(); }); + + QUnit.test('no attachment on list view', function (assert) { + assert.expect(4); + + var list = createView({ + View: ListView, + model: 'partner', + data: this.data, + groupBy: ['display_name'], + viewOptions: {sidebar: true}, + arch: '<tree string="Partners">' + + '<field name="display_name"/>' + + '</tree>', + mockRPC: function (route, args) { + assert.step(args.model); + return this._super.apply(this, arguments); + } + }); + + // select record then trigger render + list.$('.o_group_header:last').click(); + list.$('.o_data_row input').click(); + list.$('.o_group_header:first').click(); + + assert.verifySteps(['partner', 'partner', 'partner'], + "ir.attachment not called when selecting record in list view"); + + list.destroy(); + }); }); }); |
