From 4e396aeeb3b8b7c406517b29a301f64fee22b47a Mon Sep 17 00:00:00 2001 From: Bruno Boi Date: Thu, 6 Apr 2023 09:37:56 +0000 Subject: [PATCH] [FIX] web: remove a window global assignation Since 5da90dfc4 a test has been added in which a global readonly variable from `window` is reassigned. Furthermore, it is the global "parent" which is read-only and should nerver be modified. closes odoo/odoo#117927 X-original-commit: 169a471c7d48891d3295e2b597300425fb145abc Signed-off-by: Mathieu Duckerts-Antoine Signed-off-by: Bruno Boi (boi) --- addons/web/static/tests/search/control_panel.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/web/static/tests/search/control_panel.js b/addons/web/static/tests/search/control_panel.js index 38da98c676a..8c350911081 100644 --- a/addons/web/static/tests/search/control_panel.js +++ b/addons/web/static/tests/search/control_panel.js @@ -138,16 +138,17 @@ QUnit.module("Search", (hooks) => { QUnit.test("control panel without bottom-right specifics", async (assert) => { class CustomPage extends Component {} CustomPage.components = { ControlPanel }; - CustomPage.template = xml ` + CustomPage.template = xml`
Something else
`; - // Minimal config, still needs at least an empty breadcrumbs to setup a control_panel - const env = { ...await makeTestEnv(), config: { breadcrumbs: [], } }; - parent = await mount(CustomPage, target, { env }); + // Minimal config, still needs at least an empty breadcrumbs to setup a control_panel + const env = await makeTestEnv(); + Object.assign(env, { config: { breadcrumbs: [] } }); + await mount(CustomPage, target, { env }); assert.containsOnce(target, ".o_new_bottom_right"); assert.containsNone(target, ".o_cp_switch_buttons"); assert.containsNone(target, ".o_pager");