Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Test for adding and removing a reaction in a thread #11839

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions cypress/e2e/read-receipts/reactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,38 @@ describe("Read receipts", () => {
assertReadThread("Msg1");
assertReadThread("Msg2");
});
it("Can remove a reaction in a thread", () => {
// Note: this is not strictly a read receipt test, but it checks
// for a bug we caused when we were fixing unreads, so it's
// included here. The bug is:
// https://github.com/vector-im/element-web/issues/26498

// Given a thread exists
goTo(room1);
assertRead(room2);
receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Reply1a")]);
assertUnread(room2, 2);

// When I react to a thread message
goTo(room2);
openThread("Msg1");
cy.get(".mx_ThreadPanel").findByText("Reply1a").realHover();
cy.findByRole("button", { name: "React" }).click();
cy.get(".mx_EmojiPicker_body").findByText("😀").click();

// And cancel the reaction
cy.get(".mx_ThreadPanel").findByLabelText("Mae reacted with 😀").click();

// Then it disappears
cy.get(".mx_ThreadPanel").findByLabelText("Mae reacted with 😀").should("not.exist");

// And I can do it all again without an error
cy.get(".mx_ThreadPanel").findByText("Reply1a").realHover();
cy.findByRole("button", { name: "React" }).click();
cy.get(".mx_EmojiPicker_body").findAllByText("😀").first().click();
cy.get(".mx_ThreadPanel").findByLabelText("Mae reacted with 😀").click();
cy.get(".mx_ThreadPanel").findByLabelText("Mae reacted with 😀").should("not.exist");
});
});

describe("thread roots", () => {
Expand Down
Loading