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
Merge branch 'develop' into weeman1337/prettier
This commit is contained in:
@ -35,11 +35,16 @@ import {
|
||||
canEditOwnEvent,
|
||||
fetchInitialEvent,
|
||||
findEditableEvent,
|
||||
highlightEvent,
|
||||
isContentActionable,
|
||||
isLocationEvent,
|
||||
isVoiceMessage,
|
||||
} from "../../src/utils/EventUtils";
|
||||
import { getMockClientWithEventEmitter, makeBeaconInfoEvent, makePollStartEvent, stubClient } from "../test-utils";
|
||||
import dis from "../../src/dispatcher/dispatcher";
|
||||
import { Action } from "../../src/dispatcher/actions";
|
||||
|
||||
jest.mock("../../src/dispatcher/dispatcher");
|
||||
|
||||
describe("EventUtils", () => {
|
||||
const userId = "@user:server";
|
||||
@ -441,4 +446,19 @@ describe("EventUtils", () => {
|
||||
).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("highlightEvent", () => {
|
||||
const eventId = "$zLg9jResFQmMO_UKFeWpgLgOgyWrL8qIgLgZ5VywrCQ";
|
||||
|
||||
it("should dispatch an action to view the event", () => {
|
||||
highlightEvent(roomId, eventId);
|
||||
expect(dis.dispatch).toHaveBeenCalledWith({
|
||||
action: Action.ViewRoom,
|
||||
event_id: eventId,
|
||||
highlighted: true,
|
||||
room_id: roomId,
|
||||
metricsTrigger: undefined,
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user