From 3bc23ce5a5ad271d4529af47773866766c2cf634 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Tue, 10 Oct 2023 10:00:31 +0200 Subject: [PATCH] [FIX] web_editor: properly implement Powerbox navigation test A Powerbox test was executed without first setting the selection in the DOM, which caused the Powerbox to close immediately. It also omitted to reopen the Powerbox after the first command selection, before using the arrow keys to navigate through the commands. Part-of: odoo/odoo#141303 --- .../static/src/js/editor/odoo-editor/test/spec/powerbox.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/powerbox.test.js b/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/powerbox.test.js index feb1ebf4e24..e2a9f6f2b2a 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/powerbox.test.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/powerbox.test.js @@ -135,10 +135,12 @@ describe('Powerbox', () => { ], editable, }); + setSelection(editable, 0); powerbox.open(); window.chai.expect(editable.innerText).to.eql(''); await triggerEvent(editable, 'keydown', { key: 'Enter'}); window.chai.expect(editable.innerText).to.eql('1'); + powerbox.open(); await triggerEvent(editable, 'keydown', { key: 'ArrowDown'}); await triggerEvent(editable, 'keydown', { key: 'Enter'}); window.chai.expect(editable.innerText).to.eql('2');