From a42e42ff156c46a96f7ac3266a87da541ba81102 Mon Sep 17 00:00:00 2001 From: tsm-odoo Date: Fri, 29 Dec 2023 10:46:19 +0100 Subject: [PATCH] [FIX] mail: fix non deterministic im status test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this PR the "Can handle im_status of unknown partner" test was sometimes failing. This test is not related to im_status: it tests that receiving a `mail.record/insert` notification properly inserts the data in the store. This flow is already thoroughly tested as many discuss functionalities rely on this mechanism. This PR removes this test. fixes runbot-52628 closes odoo/odoo#147705 X-original-commit: 39a368238f5fc9b8d8d4115f14a05499322e92e6 Signed-off-by: Sébastien Theys (seb) Signed-off-by: Matthieu Stockbauer (tsm) --- .../static/tests/discuss_app/im_status_tests.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/addons/mail/static/tests/discuss_app/im_status_tests.js b/addons/mail/static/tests/discuss_app/im_status_tests.js index abb54877b5b..614c6a4548a 100644 --- a/addons/mail/static/tests/discuss_app/im_status_tests.js +++ b/addons/mail/static/tests/discuss_app/im_status_tests.js @@ -6,7 +6,6 @@ import { startServer } from "@bus/../tests/helpers/mock_python_environment"; import { Command } from "@mail/../tests/helpers/command"; import { start } from "@mail/../tests/helpers/test_utils"; -import { nextTick } from "@web/../tests/helpers/utils"; import { click, contains } from "@web/../tests/utils"; QUnit.module("im status"); @@ -83,22 +82,6 @@ QUnit.test("change icon on change partner im_status", async () => { await contains(".o-mail-ImStatus i[title='Online']"); }); -QUnit.test("Can handle im_status of unknown partner", async (assert) => { - const { env, pyEnv } = await start(); - const partnerId = pyEnv["res.partner"].create({ name: "Bob" }); - const channelId = pyEnv["discuss.channel"].create({ - name: "General", - }); - const [channel] = pyEnv["discuss.channel"].searchRead([["id", "=", channelId]]); - pyEnv["bus.bus"]._sendone(channel, "mail.record/insert", { - Persona: { im_status: "online", id: partnerId, type: "partner" }, - }); - await nextTick(); - const persona = env.services["mail.store"].Persona.get({ type: "partner", id: partnerId }); - assert.ok(persona); - assert.ok(persona.im_status === "online"); -}); - QUnit.test("show im status in messaging menu preview of chat", async () => { const pyEnv = await startServer(); const partnerId = pyEnv["res.partner"].create({ name: "Demo", im_status: "online" });