1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-31 13:44:28 +03:00

Add voice broadcast ended message (#9728)

This commit is contained in:
Michael Weimann
2022-12-12 16:03:56 +01:00
committed by GitHub
parent 9de5654353
commit 57e1822add
11 changed files with 286 additions and 23 deletions

View File

@ -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';
@ -440,4 +445,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,
});
});
});
});