diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-08-27 16:44:17 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-08-27 16:44:17 +0200 |
| commit | 9947133361f4d6fc4c9cbb68e2e2230728fcdafd (patch) | |
| tree | 4fc266cd52f55d94f86d7df2ab75323e35fde99c /addons/web/static/tests/views/graph_tests.js | |
| parent | f7ead5fd50f4b6db2a1d4c947fc4e15dceedbbd7 (diff) | |
| parent | 40430699dfbba715b143c109ebae415074da9f40 (diff) | |
[MERGE] forward port branch saas-11.5 up to 40430699dfb
Diffstat (limited to 'addons/web/static/tests/views/graph_tests.js')
| -rw-r--r-- | addons/web/static/tests/views/graph_tests.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/addons/web/static/tests/views/graph_tests.js b/addons/web/static/tests/views/graph_tests.js index 0c3b664afc5..2e74e36e5e1 100644 --- a/addons/web/static/tests/views/graph_tests.js +++ b/addons/web/static/tests/views/graph_tests.js @@ -152,6 +152,29 @@ QUnit.module('Views', { }); }); + QUnit.test('displaying line chart data with multiple groupbys', function (assert) { + // this test makes sure the line chart shows all data labels (X axis) when + // it is grouped by several fields + assert.expect(3); + + var graph = createView({ + View: GraphView, + model: 'foo', + data: this.data, + arch: '<graph type="line"><field name="foo" /></graph>', + groupBy: ['product_id', 'bar'], + }); + + assert.strictEqual(graph.$('.nv-x text:contains(xphone)').length, 1, + "should contain a text element with product xphone on X axis"); + assert.strictEqual(graph.$('.nv-x text:contains(xpad)').length, 1, + "should contain a text element with product xpad on X axis"); + assert.strictEqual(graph.$('text:contains(true)').length, 1, + "should have an entry for each value of field 'bar' in the legend"); + + graph.destroy(); + }); + QUnit.test('switching measures', function (assert) { var done = assert.async(); assert.expect(4); |
