diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-11-29 20:06:16 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-11-29 20:06:16 +0100 |
| commit | ce4cc24621bf6430d7d3a2d469b375b59120c200 (patch) | |
| tree | 3837b5fe41ff88b24136ab53c871bc01f965cab1 /addons/board/static/tests/dashboard_tests.js | |
| parent | 4d7aa97da38e497fef31a06543bfa5d2c8785708 (diff) | |
| parent | 82a1e1dcc33d7c123e50d3e1aacb5e127f57c521 (diff) | |
[MERGE] forward port branch 12.0 up to 82a1e1dcc33
Diffstat (limited to 'addons/board/static/tests/dashboard_tests.js')
| -rw-r--r-- | addons/board/static/tests/dashboard_tests.js | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/addons/board/static/tests/dashboard_tests.js b/addons/board/static/tests/dashboard_tests.js index 1803875d33c..2426b1a377b 100644 --- a/addons/board/static/tests/dashboard_tests.js +++ b/addons/board/static/tests/dashboard_tests.js @@ -700,6 +700,64 @@ QUnit.test('save actions to dashboard', function (assert) { actionManager.destroy(); }); +QUnit.test('save two searches to dashboard', function (assert) { + // the second search saved should not be influenced by the first + assert.expect(2); + + var actionManager = createActionManager({ + data: this.data, + archs: { + 'partner,false,list': '<list><field name="foo"/></list>', + 'partner,false,search': '<search></search>', + }, + mockRPC: function (route, args) { + if (route === '/board/add_to_dashboard') { + if (filter_count === 0) { + assert.deepEqual(args.domain, [["display_name", "ilike", "a"]], + "the correct domain should be sent"); + } + if (filter_count === 1) { + assert.deepEqual(args.domain, [["display_name", "ilike", "b"]], + "the correct domain should be sent"); + } + + filter_count += 1; + return $.when(true); + } + return this._super.apply(this, arguments); + }, + }); + + actionManager.doAction({ + id: 1, + res_model: 'partner', + type: 'ir.actions.act_window', + views: [[false, 'list']], + }); + + var filter_count = 0; + // Add a first filter + $('span.fa-filter').click(); + $('.o_add_custom_filter:visible').click(); + $('.o_searchview_extended_prop_value .o_input').val('a') + $('.o_apply_filter').click(); + // Add it to dashboard + $('.o_add_to_dashboard_button').click(); + // Remove it + $('.o_facet_remove').click(); + + // Add the second filter + $('span.fa-filter').click(); + $('span.fa-filter').click(); + $('.o_add_custom_filter:visible').click(); + $('.o_searchview_extended_prop_value .o_input').val('b') + $('.o_apply_filter').click(); + // Add it to dashboard + $('.o_add_to_dashboard_button').click(); + + actionManager.destroy(); +}); + QUnit.test('save to dashboard actions with flag keepSearchView', function (assert) { assert.expect(4); |
