Fix cypress RTE flaky test (#9920)

* Update @matrix-org/matrix-wysiwyg to 0.19.0
* Press {enter} to send message
This commit is contained in:
Florian Duros 2023-01-18 10:09:25 +01:00 committed by GitHub
parent 70d3d03c15
commit e4a9684d76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 10 deletions

View file

@ -120,9 +120,8 @@ describe("Composer", () => {
// Type another
cy.get("div[contenteditable=true]").type("my message 1");
// Press enter. Would be nice to just use {enter} but we can't because Cypress
// does not trigger an insertParagraph when you do that.
cy.get("div[contenteditable=true]").trigger("input", { inputType: "insertParagraph" });
// Send message
cy.get("div[contenteditable=true]").type("{enter}");
// It was sent
cy.contains(".mx_EventTile_body", "my message 1");
});
@ -141,7 +140,7 @@ describe("Composer", () => {
it("only sends when you press Ctrl+Enter", () => {
// Type a message and press Enter
cy.get("div[contenteditable=true]").type("my message 3");
cy.get("div[contenteditable=true]").trigger("input", { inputType: "insertParagraph" });
cy.get("div[contenteditable=true]").type("{enter}");
// It has not been sent yet
cy.contains(".mx_EventTile_body", "my message 3").should("not.exist");