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:
parent
d3da171765
commit
6f1a3af895
3 changed files with 409 additions and 11 deletions
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue