[FIX] mail: make deterministic "open the chatWindow of a channel..."

Very rarely the "project" channel would be created in a different second
than the general "channel", which lead to last interest taking priority
over id when sorting them and unexpectedly putting project first.

runbot-28637

closes odoo/odoo#144580

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Sébastien Theys
2023-12-04 13:23:38 +00:00
parent a445f36550
commit 0a62497445
@@ -36,8 +36,24 @@ QUnit.test("open the chatWindow of a user from the command palette", async () =>
QUnit.test("open the chatWindow of a channel from the command palette", async () => {
const pyEnv = await startServer();
pyEnv["discuss.channel"].create({ name: "general" });
pyEnv["discuss.channel"].create({ name: "project" });
pyEnv["discuss.channel"].create({
name: "general",
channel_member_ids: [
Command.create({
partner_id: pyEnv.currentPartnerId,
last_interest_dt: "2021-01-02 10:00:00", // same last interest to sort by id
}),
],
});
pyEnv["discuss.channel"].create({
name: "project",
channel_member_ids: [
Command.create({
partner_id: pyEnv.currentPartnerId,
last_interest_dt: "2021-01-02 10:00:00", // same last interest to sort by id
}),
],
});
const { advanceTime } = await start({ hasTimeControl: true });
triggerHotkey("control+k");
await insertText(".o_command_palette_search input", "#");