diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-06-21 15:16:54 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-06-21 15:16:54 +0200 |
| commit | 78b2063b29a321d152df9badb2d0324578ffe2ec (patch) | |
| tree | 8ecfa4d4acec837795d84f75c39dc10ab98929d8 /addons/web/static/tests/views/control_panel_tests.js | |
| parent | e416428669fb18b59893b63f1d9769e871ac9321 (diff) | |
| parent | 8747d72f1efbc3f32c41c20d4d3198410639d2aa (diff) | |
[MERGE] forward port branch saas-12.2 up to 8747d72f1ef
Diffstat (limited to 'addons/web/static/tests/views/control_panel_tests.js')
| -rw-r--r-- | addons/web/static/tests/views/control_panel_tests.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/addons/web/static/tests/views/control_panel_tests.js b/addons/web/static/tests/views/control_panel_tests.js index 2e0a369ab4a..7d033e5f1e4 100644 --- a/addons/web/static/tests/views/control_panel_tests.js +++ b/addons/web/static/tests/views/control_panel_tests.js @@ -418,6 +418,47 @@ QUnit.module('Views', { controlPanel.destroy(); }); + QUnit.test('Favorites Use by Default and Share are exclusive', async function (assert) { + assert.expect(11); + var controlPanel = await createControlPanel({ + model: 'partner', + arch: "<search></search>", + data: this.data, + searchMenuTypes: ['favorite'], + }); + testUtils.dom.click(controlPanel.$('.o_favorites_menu_button')); + testUtils.dom.click(controlPanel.$('button.o_add_favorite')); + var $checkboxes = controlPanel.$('input[type="checkbox"]'); + + assert.strictEqual($checkboxes.length, 2, + '2 checkboxes are present') + + assert.notOk($checkboxes[0].checked, 'Start: None of the checkboxes are checked (1)'); + assert.notOk($checkboxes[1].checked, 'Start: None of the checkboxes are checked (2)'); + + testUtils.dom.click($checkboxes.eq(0)); + assert.ok($checkboxes[0].checked, 'The first checkbox is checked'); + assert.notOk($checkboxes[1].checked, 'The second checkbox is not checked'); + + testUtils.dom.click($checkboxes.eq(1)); + assert.notOk($checkboxes[0].checked, + 'Clicking on the second checkbox checks it, and unchecks the first (1)'); + assert.ok($checkboxes[1].checked, + 'Clicking on the second checkbox checks it, and unchecks the first (2)'); + + testUtils.dom.click($checkboxes.eq(0)); + assert.ok($checkboxes[0].checked, + 'Clicking on the first checkbox checks it, and unchecks the second (1)'); + assert.notOk($checkboxes[1].checked, + 'Clicking on the first checkbox checks it, and unchecks the second (2)'); + + testUtils.dom.click($checkboxes.eq(0)); + assert.notOk($checkboxes[0].checked, 'End: None of the checkboxes are checked (1)'); + assert.notOk($checkboxes[1].checked, 'End: None of the checkboxes are checked (2)'); + + controlPanel.destroy(); + }); + QUnit.test('load filter', async function (assert) { assert.expect(1); |
