You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Properly generate mentions when editing a reply with MSC3952 (#10486)
* remove redundant feature_intentional_mentions settings check * tests * pass replytoevent to attachmmentions in editmessagecomposer * lint * strict fix
This commit is contained in:
@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { MockedObject } from "jest-mock";
|
||||
import { MatrixClient, MatrixEvent, EventType, Room } from "matrix-js-sdk/src/matrix";
|
||||
import { MatrixClient, MatrixEvent, EventType, Room, EventTimeline } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import { IRoomState } from "../../src/components/structures/RoomView";
|
||||
import { TimelineRenderingType } from "../../src/contexts/RoomContext";
|
||||
@ -91,3 +91,12 @@ export function getRoomContext(room: Room, override: Partial<IRoomState>): IRoom
|
||||
...override,
|
||||
};
|
||||
}
|
||||
|
||||
export const setupRoomWithEventsTimeline = (room: Room, events: MatrixEvent[] = []): void => {
|
||||
const timelineSet = room.getUnfilteredTimelineSet();
|
||||
const getTimelineForEventSpy = jest.spyOn(timelineSet, "getTimelineForEvent");
|
||||
const eventTimeline = {
|
||||
getEvents: jest.fn().mockReturnValue(events),
|
||||
} as unknown as EventTimeline;
|
||||
getTimelineForEventSpy.mockReturnValue(eventTimeline);
|
||||
};
|
||||
|
Reference in New Issue
Block a user