[FIX] web_editor: make a test more robust
Don't know how this test worked before but it will stop working with next updates. This just make it more robust using the same trick as other tests: wait for the colorpicker to be opened before actually using it. Part of https://github.com/odoo/odoo/pull/52211 Related to task-2197038
This commit is contained in:
@@ -376,7 +376,16 @@ QUnit.module('web_editor', {}, function () {
|
||||
Wysiwyg.setRange(pText, 1, pText, 10);
|
||||
// text is selected
|
||||
|
||||
await testUtils.dom.click($field.find('.note-toolbar .note-back-color-preview button:first'));
|
||||
async function openColorpicker(selector) {
|
||||
const $colorpicker = $field.find(selector);
|
||||
const openingProm = new Promise(resolve => {
|
||||
$colorpicker.one('shown.bs.dropdown', () => resolve());
|
||||
});
|
||||
await testUtils.dom.click($colorpicker.find('button:first'));
|
||||
return openingProm;
|
||||
}
|
||||
|
||||
await openColorpicker('.note-toolbar .note-back-color-preview');
|
||||
await testUtils.dom.click($field.find('.note-toolbar .note-back-color-preview button.bg-gamma'));
|
||||
|
||||
await testUtils.form.clickSave(form);
|
||||
|
||||
Reference in New Issue
Block a user