[FIX] mail: fix message separator appearing after showing composer

closes odoo/odoo#118875

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
tsm-odoo
2023-04-18 19:28:50 +02:00
committed by Didier (did)
parent c5bb2d0838
commit e55ba11a89
2 changed files with 25 additions and 1 deletions
+1 -1
View File
@@ -26,7 +26,7 @@
</div>
<t t-set="currentDay" t-value="msg.dateDay"/>
</t>
<Transition visible="props.thread.seen_message_id === (prevMsg?.id ?? false)" name="'o-fade'" t-slot-scope="transition">
<Transition t-if="props.thread.isChannel" visible="props.thread.seen_message_id === (prevMsg?.id ?? false)" name="'o-fade'" t-slot-scope="transition">
<div class="o-mail-Thread-newMessage d-flex align-items-center fw-bolder" t-att-class="{ 'opacity-0': transition.className.includes('o-fade-leave') }">
<hr class="flex-grow-1 border opacity-50"/><span class="px-3">New messages</span>
</div>
@@ -985,3 +985,27 @@ QUnit.test("can be marked as read while loading", async function (assert) {
await afterNextRender(loadDeferred.resolve);
assert.containsNone($, ".o-mail-DiscussCategoryItem-counter");
});
QUnit.test(
"New message separator not appearing after showing composer on thread",
async (assert) => {
const pyEnv = await startServer();
pyEnv["mail.message"].create([
{
model: "res.partner",
res_id: pyEnv.currentPartnerId,
body: "Message on partner",
},
{
model: "res.partner",
res_id: pyEnv.currentPartnerId,
body: "Message on partner",
},
]);
const { openFormView } = await start();
await openFormView("res.partner", pyEnv.currentPartnerId);
assert.containsNone($, ".o-mail-Thread-newMessage");
await click("button:contains(Log note)");
assert.containsNone($, ".o-mail-Thread-newMessage");
}
);