diff options
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); |
