From 0c919774ea40fcdd477a3c9f9ed74f26839029eb Mon Sep 17 00:00:00 2001 From: tsm-odoo Date: Tue, 2 May 2023 10:54:53 +0000 Subject: [PATCH] [FIX] mail: fix non-deterministic message test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- addons/mail/static/tests/message/message_tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/tests/message/message_tests.js b/addons/mail/static/tests/message/message_tests.js index f3949e021af..8603378b4f6 100644 --- a/addons/mail/static/tests/message/message_tests.js +++ b/addons/mail/static/tests/message/message_tests.js @@ -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"); } );