summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/views/graph_tests.js
diff options
context:
space:
mode:
authorRomainLibert <rli@odoo.com>2018-07-03 15:34:32 +0200
committerRomainLibert <rli@odoo.com>2018-07-10 12:25:24 +0200
commitdc75248b89bcb6e839bcdf30830cdc5dbb9d80ec (patch)
tree59249d1f8483dd306715eea200f817499b9c168c /addons/web/static/tests/views/graph_tests.js
parentb87a95b6d6b846b660506a3f4ef3472ebc4df809 (diff)
[IMP] web: sort measures in graph view and pivot view
Diffstat (limited to 'addons/web/static/tests/views/graph_tests.js')
-rw-r--r--addons/web/static/tests/views/graph_tests.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/addons/web/static/tests/views/graph_tests.js b/addons/web/static/tests/views/graph_tests.js
index 5f7227815c1..60e6680993c 100644
--- a/addons/web/static/tests/views/graph_tests.js
+++ b/addons/web/static/tests/views/graph_tests.js
@@ -622,6 +622,30 @@ QUnit.module('Views', {
assert.ok(true,"should not generate any error");
graph.destroy();
});
+
+ QUnit.test('graph measures should be alphabetically sorted', function (assert) {
+ assert.expect(2);
+
+ var data = this.data;
+ data.foo.fields.bouh = {string: "bouh", type: "integer"};
+
+ var graph = createView({
+ View: GraphView,
+ model: "foo",
+ data: data,
+ arch: '<graph string="Partners">' +
+ '<field name="foo" type="measure"/>' +
+ '<field name="bouh" type="measure"/>' +
+ '</graph>',
+ })
+
+ assert.strictEqual(graph.$buttons.find('.o_graph_measures_list li:first').data('field'), 'bouh',
+ "Bouh should be the first measure");
+ assert.strictEqual(graph.$buttons.find('.o_graph_measures_list li:last').data('field'), '__count__',
+ "Count should be the last measure");
+
+ graph.destroy();
+ });
});
});