diff options
Diffstat (limited to 'addons/web/static/tests/widgets/data_export_tests.js')
| -rw-r--r-- | addons/web/static/tests/widgets/data_export_tests.js | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/addons/web/static/tests/widgets/data_export_tests.js b/addons/web/static/tests/widgets/data_export_tests.js index c9c51219571..2d3488f5891 100644 --- a/addons/web/static/tests/widgets/data_export_tests.js +++ b/addons/web/static/tests/widgets/data_export_tests.js @@ -1,12 +1,13 @@ odoo.define('web.data_export_tests', function (require) { "use strict"; -var framework = require('web.framework'); -var ListView = require('web.ListView'); -var testUtils = require('web.test_utils'); -var data = require('web.data'); +const framework = require('web.framework'); +const ListView = require('web.ListView'); +const testUtils = require('web.test_utils'); +const data = require('web.data'); -var createView = testUtils.createView; +const cpHelpers = testUtils.controlPanel; +const createView = testUtils.createView; QUnit.module('widgets', { beforeEach: function () { @@ -63,7 +64,7 @@ QUnit.module('widgets', { data: this.data, arch: '<tree><field name="foo"/></tree>', viewOptions: { - hasSidebar: true, + hasActionMenus: true, }, mockRPC: function (route) { if (route === '/web/export/formats') { @@ -104,9 +105,11 @@ QUnit.module('widgets', { }, }); + await testUtils.dom.click(list.$('thead th.o_list_record_selector input')); - await testUtils.dom.click(list.sidebar.$('.o_dropdown_toggler_btn:contains(Action)')); - await testUtils.dom.click(list.sidebar.$('a:contains(Export)')); + + await cpHelpers.toggleActionMenu(list); + await cpHelpers.toggleMenuItem(list, 'Export'); assert.strictEqual($('.modal').length, 1, "a modal dialog should be open"); assert.strictEqual($('div.o_tree_column:contains(Activities)').length, 1, @@ -144,7 +147,7 @@ QUnit.module('widgets', { data: this.data, arch: '<tree><field name="foo"/></tree>', viewOptions: { - hasSidebar: true, + hasActionMenus: true, }, mockRPC: function (route) { if (route === '/web/export/formats') { @@ -179,10 +182,12 @@ QUnit.module('widgets', { }, }); + // Open the export modal await testUtils.dom.click(list.$('thead th.o_list_record_selector input')); - await testUtils.dom.click(list.sidebar.$('.o_dropdown_toggler_btn:contains(Action)')); - await testUtils.dom.click(list.sidebar.$('a:contains(Export)')); + await cpHelpers.toggleActionMenu(list); + await cpHelpers.toggleMenuItem(list, 'Export'); + assert.strictEqual($('.modal').length, 1, "a modal dialog should be open"); @@ -214,7 +219,7 @@ QUnit.module('widgets', { data: this.data, arch: '<tree><field name="foo"/></tree>', viewOptions: { - hasSidebar: true, + hasActionMenus: true, }, mockRPC: function (route) { if (route === '/web/export/formats') { @@ -248,10 +253,12 @@ QUnit.module('widgets', { return this._super.apply(this, arguments); }, }); + + // Open the export modal - await testUtils.dom.click(list.$('thead .o_list_record_selector input')); - await testUtils.dom.click(list.sidebar.$('.o_dropdown_toggler_btn:contains(Action)')); - await testUtils.dom.click(list.sidebar.$('a:contains(Export)')); + await testUtils.dom.click(list.$('thead th.o_list_record_selector input')); + await cpHelpers.toggleActionMenu(list); + await cpHelpers.toggleMenuItem(list, 'Export'); assert.strictEqual($('.modal .o_export_tree_item:visible').length, 2, "There should be only two items visible"); await testUtils.dom.click($('.modal .o_export_search_input')); @@ -333,7 +340,6 @@ QUnit.module('widgets', { View: ListView, model: 'partner', data: this.data, - debug: true, arch: ` <tree> <field name="foo"/> |
