diff --git a/addons/web/static/src/js/views/graph/graph_renderer.js b/addons/web/static/src/js/views/graph/graph_renderer.js index 1fbd6572a9a..da5709a6261 100644 --- a/addons/web/static/src/js/views/graph/graph_renderer.js +++ b/addons/web/static/src/js/views/graph/graph_renderer.js @@ -56,7 +56,7 @@ return AbstractRenderer.extend({ on_attach_callback: function () { this._super.apply(this, arguments); this.isInDOM = true; - this._renderGraph(); + this._render(); }, /** * @override diff --git a/addons/web/static/tests/views/graph_tests.js b/addons/web/static/tests/views/graph_tests.js index 028eb4cb3a3..7bb2fce78b5 100644 --- a/addons/web/static/tests/views/graph_tests.js +++ b/addons/web/static/tests/views/graph_tests.js @@ -190,6 +190,25 @@ QUnit.module('Views', { }); QUnit.test('no content helper', function (assert) { + assert.expect(2); + this.data.foo.records = []; + + var graph = createView({ + View: GraphView, + model: "foo", + data: this.data, + arch: '' + + '' + + '', + }); + assert.strictEqual(graph.$('div.o_graph_svg_container svg.nvd3-svg').length, 0, + "should not contain a div with a svg element"); + assert.strictEqual(graph.$('div.o_view_nocontent').length, 1, + "should display the no content helper"); + graph.destroy(); + }); + + QUnit.test('no content helper after update', function (assert) { var done = assert.async(); assert.expect(4);