Prevent starting another voice broadcast (#9457)
This commit is contained in:
parent
13fbd096b0
commit
8066b9ffbe
3 changed files with 49 additions and 2 deletions
|
@ -67,6 +67,7 @@ describe("startNewVoiceBroadcastRecording", () => {
|
|||
|
||||
recordingsStore = {
|
||||
setCurrent: jest.fn(),
|
||||
getCurrent: jest.fn(),
|
||||
} as unknown as VoiceBroadcastRecordingsStore;
|
||||
|
||||
infoEvent = mkVoiceBroadcastInfoStateEvent(roomId, VoiceBroadcastInfoState.Started, client.getUserId());
|
||||
|
@ -132,7 +133,25 @@ describe("startNewVoiceBroadcastRecording", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("when there already is a live broadcast of the current user", () => {
|
||||
describe("when there is already a current voice broadcast", () => {
|
||||
beforeEach(async () => {
|
||||
mocked(recordingsStore.getCurrent).mockReturnValue(
|
||||
new VoiceBroadcastRecording(infoEvent, client),
|
||||
);
|
||||
|
||||
result = await startNewVoiceBroadcastRecording(room, client, recordingsStore);
|
||||
});
|
||||
|
||||
it("should not start a voice broadcast", () => {
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
it("should show an info dialog", () => {
|
||||
expect(Modal.createDialog).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when there already is a live broadcast of the current user in the room", () => {
|
||||
beforeEach(async () => {
|
||||
room.currentState.setStateEvents([
|
||||
mkVoiceBroadcastInfoStateEvent(roomId, VoiceBroadcastInfoState.Running, client.getUserId()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue