diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-05-29 17:34:43 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-05-29 17:34:43 +0200 |
| commit | f36e6917bd73a56dc0c7468b4849920df4088154 (patch) | |
| tree | b63d02ae3e5ffc0815de009407363e0cf906f547 /addons/web/static/tests/views/pivot_tests.js | |
| parent | bc0173c2d58ac26d80cb2f483a95c0c13b047dab (diff) | |
| parent | 37eed7c509fb5846c89ef37046df4b3cab299719 (diff) | |
[MERGE] forward port branch saas-11.3 up to 37eed7c509f
Diffstat (limited to 'addons/web/static/tests/views/pivot_tests.js')
| -rw-r--r-- | addons/web/static/tests/views/pivot_tests.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/addons/web/static/tests/views/pivot_tests.js b/addons/web/static/tests/views/pivot_tests.js index a1d9e1fae1f..4d7358f2574 100644 --- a/addons/web/static/tests/views/pivot_tests.js +++ b/addons/web/static/tests/views/pivot_tests.js @@ -1145,4 +1145,37 @@ QUnit.module('Views', { pivot.destroy(); }); + + QUnit.test('parallel data loading should discard all but the last one', function (assert) { + assert.expect(2); + + var def; + + var pivot = createView({ + View: PivotView, + model: "partner", + data: this.data, + arch: '<pivot>' + + '<field name="foo" type="measure"/>' + + '</pivot>', + mockRPC: function (route, args) { + var result = this._super.apply(this, arguments); + if (args.method === 'read_group') { + return $.when(def).then(_.constant(result)); + } + return result; + }, + }); + + def = $.Deferred(); + pivot.update({groupBy: ['product_id']}); + pivot.update({groupBy: ['product_id', 'customer']}); + def.resolve(); + + assert.strictEqual(pivot.$('.o_pivot_cell_value').length, 6, + "should have 6 cells"); + assert.strictEqual(pivot.$('tbody tr').length, 6, + "should have 6 rows"); + pivot.destroy(); + }); });}); |
