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

View file

@ -57,7 +57,7 @@
"dependencies": { "dependencies": {
"@babel/runtime": "^7.12.5", "@babel/runtime": "^7.12.5",
"@matrix-org/analytics-events": "^0.4.0", "@matrix-org/analytics-events": "^0.4.0",
"@matrix-org/matrix-wysiwyg": "^0.16.0", "@matrix-org/matrix-wysiwyg": "^0.19.0",
"@matrix-org/react-sdk-module-api": "^0.0.3", "@matrix-org/react-sdk-module-api": "^0.0.3",
"@sentry/browser": "^7.0.0", "@sentry/browser": "^7.0.0",
"@sentry/tracing": "^7.0.0", "@sentry/tracing": "^7.0.0",

View file

@ -36,7 +36,7 @@ const mockWysiwyg = {
const openLinkModalSpy = jest.spyOn(LinkModal, "openLinkModal"); const openLinkModalSpy = jest.spyOn(LinkModal, "openLinkModal");
const testCases: Record< const testCases: Record<
Exclude<ActionTypes, "undo" | "redo" | "clear">, Exclude<ActionTypes, "undo" | "redo" | "clear" | "codeBlock">,
{ label: string; mockFormatFn: jest.Func | jest.SpyInstance } { label: string; mockFormatFn: jest.Func | jest.SpyInstance }
> = { > = {
bold: { label: "Bold", mockFormatFn: mockWysiwyg.bold }, bold: { label: "Bold", mockFormatFn: mockWysiwyg.bold },

View file

@ -1589,10 +1589,10 @@
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-js/-/matrix-sdk-crypto-js-0.1.0-alpha.2.tgz#a09d0fea858e817da971a3c9f904632ef7b49eb6" resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-js/-/matrix-sdk-crypto-js-0.1.0-alpha.2.tgz#a09d0fea858e817da971a3c9f904632ef7b49eb6"
integrity sha512-oVkBCh9YP7H9i4gAoQbZzswniczfo/aIptNa4dxRi4Ff9lSvUCFv6Hvzi7C+90c0/PWZLXjIDTIAWZYmwyd2fA== integrity sha512-oVkBCh9YP7H9i4gAoQbZzswniczfo/aIptNa4dxRi4Ff9lSvUCFv6Hvzi7C+90c0/PWZLXjIDTIAWZYmwyd2fA==
"@matrix-org/matrix-wysiwyg@^0.16.0": "@matrix-org/matrix-wysiwyg@^0.19.0":
version "0.16.0" version "0.19.0"
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-wysiwyg/-/matrix-wysiwyg-0.16.0.tgz#2eb81899cedc740f522bd7c2839bd9151d67a28e" resolved "https://registry.yarnpkg.com/@matrix-org/matrix-wysiwyg/-/matrix-wysiwyg-0.19.0.tgz#5ffbabf8a59317ecdb45ba5fa1d06fff150ede40"
integrity sha512-w+/bUQ5x4lVRncrYSmdxy5ww4kkgXeSg4aFfby9c7c6o/+o4gfV6/XBdoJ71nhStyIYIweKAz8i3zA3rKonyvw== integrity sha512-1iL/+kjwWAlpWAq64DbkDkE7KGxvR5lNojZgCKMIyuvuKWv8Ikqxa9VOOYFtovKvSqgGRJaYN7/OkKWxZjiDcw==
"@matrix-org/olm@https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz": "@matrix-org/olm@https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz":
version "3.2.14" version "3.2.14"