Factor out MessageEvent.from()
usage (#9882)
* Factor out `MessageEvent.from()` usage The class/function is disappearing from the events-sdk, at least in this form. * Manually create contents for events used by cypress The utility function is out of range of the calling code at runtime, for some reason. * Run prettier * Maybe this will fix the build
This commit is contained in:
parent
34f0229d75
commit
c09ca7b4ee
5 changed files with 127 additions and 61 deletions
|
@ -16,15 +16,17 @@ limitations under the License.
|
|||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { MessageEvent } from "matrix-events-sdk";
|
||||
|
||||
import type { MsgType } from "matrix-js-sdk/src/@types/event";
|
||||
import type { ISendEventResponse } from "matrix-js-sdk/src/@types/requests";
|
||||
import type { EventType } from "matrix-js-sdk/src/@types/event";
|
||||
import { SynapseInstance } from "../../plugins/synapsedocker";
|
||||
import Chainable = Cypress.Chainable;
|
||||
|
||||
const sendEvent = (roomId: string): Chainable<ISendEventResponse> => {
|
||||
return cy.sendEvent(roomId, null, "m.room.message" as EventType, MessageEvent.from("Message").serialize().content);
|
||||
return cy.sendEvent(roomId, null, "m.room.message" as EventType, {
|
||||
msgtype: "m.text" as MsgType,
|
||||
body: "Message",
|
||||
});
|
||||
};
|
||||
|
||||
describe("Editing", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue