diff options
| author | Denis Vermylen <dve@odoo.com> | 2017-05-04 10:35:51 +0200 |
|---|---|---|
| committer | Denis Vermylen <dve@odoo.com> | 2017-05-04 10:35:51 +0200 |
| commit | 1314de50989901f9ea290b19676a6a6fa15496f8 (patch) | |
| tree | 3a57cb291c45cbb075fb439186c7474bcdb3b23c /addons/web/static/tests/fields/basic_fields_tests.js | |
| parent | 1ab0910d91bb2f2519e200faf9b1353c0a1424ff (diff) | |
| parent | c35c8c54769c0677c4353efeffd02da91a2259e8 (diff) | |
[IMP] account, sale, web: dashboard graph tooltips
Graph tooltips (found in accounts and sale/crm's dahsboards) are now
rendering a custom template in order to display more relevant and
coherent information about the graph.
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/basic_fields_tests.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index 4d14d47215c..02f59278786 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -943,8 +943,9 @@ QUnit.module('basic_fields', { QUnit.test('graph dashboard widget is rendered correctly', function (assert) { var done = assert.async(); - assert.expect(3); + assert.expect(4); + var graph_key = ""; _.extend(this.data.partner.fields, { graph_data: { string: "Graph Data", type: "text" }, graph_type: { @@ -967,6 +968,7 @@ QUnit.module('basic_fields', { key: 'A key', area: true, }]); + graph_key = JSON.parse(this.data.partner.records[0].graph_data)[0].key this.data.partner.records[1].graph_data = JSON.stringify([{ color: 'blue', title: 'Partner 1', @@ -1001,6 +1003,13 @@ QUnit.module('basic_fields', { "graph of first record should be a barchart"); assert.strictEqual(kanban.$('.o_kanban_record:nth(1) .o_graph_linechart').length, 1, "graph of second record should be a linechart"); + + var evt = document.createEvent("MouseEvents"); //taken ref from https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent + evt.initMouseEvent("mouseover", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); + $('.discreteBar')[0].dispatchEvent(evt) + var tooltip = $('.nvtooltip').find('table').find('.key')[0].innerText; + assert.equal(tooltip,graph_key, "graph tooltip should be generated ") + $('.nvtooltip').remove(); // force a re-rendering of the first record (to check if the // previous rendered graph is correctly removed from the DOM) |
