Skip to content

Commit 326531a

Browse files
committed
[FIX] mail: message reaction from emoji picker test removes reaction
Before this commit, test "Add the same reaction twice from the emoji picker" may fail non-deterministically in 18.1 on last step: the message reaction is sometimes kept, sometimes removed. The feature in 18.0 was keeping the emoji, whereas in 18.1 it now toggles the add / remove of reaction. This change of behaviour felt best with the addition of QuickReactionMenu, and for consistency this also works that way in emoji picker of message reaction. The test was not adapted but passed because the bus notifications were coming later than the burst of user actions to add emoji, thus there's flicker of showing message reaction at end when it's only temporarily and would be removed a fraction of seconds later. This commit fixes the test with the newer behaviour that it should toggle the reaction. Fixes runbot error 229340 closes odoo#218363 X-original-commit: be3c561 Signed-off-by: Matthieu Stockbauer (tsm) <[email protected]> Signed-off-by: Alexandre Kühn (aku) <[email protected]>
1 parent fb69b99 commit 326531a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

addons/mail/static/tests/message/message.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ test("Reaction summary", async () => {
759759
}
760760
});
761761

762-
test("Add the same reaction twice from the emoji picker", async () => {
762+
test("Select already reacted emoji from quick reaction removes the reaction on message", async () => {
763763
const pyEnv = await startServer();
764764
const channelId = pyEnv["discuss.channel"].create({
765765
channel_type: "channel",
@@ -775,9 +775,10 @@ test("Add the same reaction twice from the emoji picker", async () => {
775775
await openDiscuss(channelId);
776776
await click("[title='Add a Reaction']");
777777
await click(".o-mail-QuickReactionMenu button", { text: "😅" });
778+
await contains(".o-mail-MessageReaction", { text: "😅1" });
778779
await click("[title='Add a Reaction']");
779780
await click(".o-mail-QuickReactionMenu button", { text: "😅" });
780-
await contains(".o-mail-MessageReaction", { text: "😅1" });
781+
await contains(".o-mail-MessageReaction", { count: 0 });
781782
});
782783

783784
test("basic rendering of message", async () => {

0 commit comments

Comments
 (0)