Confirm listen to a broadcast while recording (#9831)
This commit is contained in:
parent
91e078d96b
commit
0f7a2ce6df
20 changed files with 213 additions and 29 deletions
|
@ -26,6 +26,7 @@ import {
|
|||
VoiceBroadcastRecording,
|
||||
VoiceBroadcastPlaybackBody,
|
||||
VoiceBroadcastPlayback,
|
||||
VoiceBroadcastRecordingsStore,
|
||||
} from "../../../src/voice-broadcast";
|
||||
import { stubClient, wrapInSdkContext } from "../../test-utils";
|
||||
import { mkVoiceBroadcastInfoStateEvent } from "../utils/test-utils";
|
||||
|
@ -91,7 +92,7 @@ describe("VoiceBroadcastBody", () => {
|
|||
);
|
||||
room.addEventsToTimeline([infoEvent], true, room.getLiveTimeline());
|
||||
testRecording = new VoiceBroadcastRecording(infoEvent, client);
|
||||
testPlayback = new VoiceBroadcastPlayback(infoEvent, client);
|
||||
testPlayback = new VoiceBroadcastPlayback(infoEvent, client, new VoiceBroadcastRecordingsStore());
|
||||
mocked(VoiceBroadcastRecordingBody).mockImplementation(({ recording }): ReactElement | null => {
|
||||
if (testRecording === recording) {
|
||||
return <div data-testid="voice-broadcast-recording-body" />;
|
||||
|
|
|
@ -32,6 +32,7 @@ import { stubClient } from "../../../test-utils";
|
|||
import { mkVoiceBroadcastInfoStateEvent } from "../../utils/test-utils";
|
||||
import dis from "../../../../src/dispatcher/dispatcher";
|
||||
import { Action } from "../../../../src/dispatcher/actions";
|
||||
import { SdkContextClass } from "../../../../src/contexts/SDKContext";
|
||||
|
||||
jest.mock("../../../../src/dispatcher/dispatcher");
|
||||
|
||||
|
@ -66,7 +67,11 @@ describe("VoiceBroadcastPlaybackBody", () => {
|
|||
});
|
||||
|
||||
beforeEach(() => {
|
||||
playback = new VoiceBroadcastPlayback(infoEvent, client);
|
||||
playback = new VoiceBroadcastPlayback(
|
||||
infoEvent,
|
||||
client,
|
||||
SdkContextClass.instance.voiceBroadcastRecordingsStore,
|
||||
);
|
||||
jest.spyOn(playback, "toggle").mockImplementation(() => Promise.resolve());
|
||||
jest.spyOn(playback, "getLiveness");
|
||||
jest.spyOn(playback, "getState");
|
||||
|
|
|
@ -66,8 +66,8 @@ describe("VoiceBroadcastPreRecordingPip", () => {
|
|||
client = stubClient();
|
||||
room = new Room("!room@example.com", client, client.getUserId() || "");
|
||||
sender = new RoomMember(room.roomId, client.getUserId() || "");
|
||||
playbacksStore = new VoiceBroadcastPlaybacksStore();
|
||||
recordingsStore = new VoiceBroadcastRecordingsStore();
|
||||
playbacksStore = new VoiceBroadcastPlaybacksStore(recordingsStore);
|
||||
mocked(requestMediaPermissions).mockResolvedValue({
|
||||
getTracks: (): Array<MediaStreamTrack> => [],
|
||||
} as unknown as MediaStream);
|
||||
|
|
|
@ -29,6 +29,7 @@ import {
|
|||
} from "../../../../src/voice-broadcast";
|
||||
import { stubClient } from "../../../test-utils";
|
||||
import { mkVoiceBroadcastInfoStateEvent } from "../../utils/test-utils";
|
||||
import { SdkContextClass } from "../../../../src/contexts/SDKContext";
|
||||
|
||||
// mock RoomAvatar, because it is doing too much fancy stuff
|
||||
jest.mock("../../../../src/components/views/avatars/RoomAvatar", () => ({
|
||||
|
@ -60,7 +61,11 @@ describe("<VoiceBroadcastSmallPlaybackBody />", () => {
|
|||
});
|
||||
|
||||
beforeEach(() => {
|
||||
playback = new VoiceBroadcastPlayback(infoEvent, client);
|
||||
playback = new VoiceBroadcastPlayback(
|
||||
infoEvent,
|
||||
client,
|
||||
SdkContextClass.instance.voiceBroadcastRecordingsStore,
|
||||
);
|
||||
jest.spyOn(playback, "toggle").mockImplementation(() => Promise.resolve());
|
||||
jest.spyOn(playback, "getLiveness");
|
||||
jest.spyOn(playback, "getState");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue