mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 01:35:49 +03:00
Fix MessageComposer test
This commit is contained in:
parent
de86221c72
commit
fda4dabf6d
2 changed files with 8 additions and 6 deletions
|
@ -102,7 +102,7 @@ interface IState {
|
|||
showVoiceBroadcastButton: boolean;
|
||||
}
|
||||
|
||||
class MessageComposer extends React.Component<IProps, IState> {
|
||||
export class MessageComposer extends React.Component<IProps, IState> {
|
||||
private dispatcherRef?: string;
|
||||
private messageComposerInput = createRef<SendMessageComposerClass>();
|
||||
private voiceRecordingButton = createRef<VoiceRecordComposerTile>();
|
||||
|
|
|
@ -21,7 +21,8 @@ import { MatrixEvent, MsgType, RoomMember } from "matrix-js-sdk/src/matrix";
|
|||
import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread";
|
||||
|
||||
import { createTestClient, mkEvent, mkStubRoom, stubClient } from "../../../test-utils";
|
||||
import MessageComposer from "../../../../src/components/views/rooms/MessageComposer";
|
||||
import MessageComposer, { MessageComposer as MessageComposerClass }
|
||||
from "../../../../src/components/views/rooms/MessageComposer";
|
||||
import MatrixClientContext from "../../../../src/contexts/MatrixClientContext";
|
||||
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
|
||||
import RoomContext from "../../../../src/contexts/RoomContext";
|
||||
|
@ -106,7 +107,7 @@ describe("MessageComposer", () => {
|
|||
it("should call notifyTimelineHeightChanged() for the same context", () => {
|
||||
dis.dispatch({
|
||||
action: "reply_to_event",
|
||||
context: (wrapper.instance as unknown as MessageComposer).context,
|
||||
context: (wrapper.instance as unknown as MessageComposerClass).context,
|
||||
});
|
||||
wrapper.update();
|
||||
|
||||
|
@ -207,7 +208,7 @@ describe("MessageComposer", () => {
|
|||
let stateBefore: any;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = wrapAndRender({ room });
|
||||
wrapper = wrapAndRender({ room }).children();
|
||||
stateBefore = { ...wrapper.instance().state };
|
||||
resizeCallback("test", {});
|
||||
wrapper.update();
|
||||
|
@ -220,7 +221,8 @@ describe("MessageComposer", () => {
|
|||
|
||||
describe("when a resize to narrow event occurred in UIStore", () => {
|
||||
beforeEach(() => {
|
||||
wrapper = wrapAndRender({ room }, true, true);
|
||||
wrapper = wrapAndRender({ room }, true, true).children();
|
||||
|
||||
wrapper.setState({
|
||||
isMenuOpen: true,
|
||||
isStickerPickerOpen: true,
|
||||
|
@ -240,7 +242,7 @@ describe("MessageComposer", () => {
|
|||
|
||||
describe("when a resize to non-narrow event occurred in UIStore", () => {
|
||||
beforeEach(() => {
|
||||
wrapper = wrapAndRender({ room }, true, false);
|
||||
wrapper = wrapAndRender({ room }, true, false).children();
|
||||
wrapper.setState({
|
||||
isMenuOpen: true,
|
||||
isStickerPickerOpen: true,
|
||||
|
|
Loading…
Reference in a new issue