[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
This commit is contained in:
Antoine Guenet
2023-11-07 21:02:24 +00:00
committed by Sébastien Geelen (sge)
parent 69b92cad60
commit 3bc23ce5a5
@@ -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');