[FIX] mail: fix non-deterministic message test

Before this PR, the `Updating the parent message of a reply also
updates the visual of the reply` test was failing in a non-deterministic
fashion.

This PR fixes this issue by replacing the `nextTick` by a  specific
`waitUntil` in order to ensure the DOM is properly updated before
asserting.

Fixes 20829 runbot issue.

closes odoo/odoo#120273

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
tsm-odoo
2023-05-02 15:59:13 +02:00
parent 6d102d4ee4
commit 0c919774ea
@@ -7,13 +7,13 @@ import {
insertText,
afterNextRender,
nextAnimationFrame,
waitUntil,
} from "@mail/../tests/helpers/test_utils";
import { deserializeDateTime } from "@web/core/l10n/dates";
const { DateTime } = luxon;
import {
editInput,
makeDeferred,
nextTick,
patchWithCleanup,
triggerEvent,
triggerHotkey,
@@ -376,7 +376,7 @@ QUnit.test(
await click(".o-mail-Message [title='Edit']");
await editInput(document.body, ".o-mail-Message .o-mail-Composer-input", "Goodbye World");
await triggerHotkey("Enter", false);
await nextTick();
await waitUntil(".o-mail-MessageInReply-message:contains(Goodbye World)");
assert.strictEqual($(".o-mail-MessageInReply-message")[0].innerText, "Goodbye World");
}
);