Check connection before starting broadcast (#9857)
This commit is contained in:
parent
fbfa174ad0
commit
be972bc913
6 changed files with 88 additions and 14 deletions
|
@ -16,6 +16,7 @@ limitations under the License.
|
|||
|
||||
import { mocked } from "jest-mock";
|
||||
import { EventType, ISendEventResponse, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
|
||||
import { SyncState } from "matrix-js-sdk/src/sync";
|
||||
|
||||
import Modal from "../../../src/Modal";
|
||||
import {
|
||||
|
@ -103,6 +104,18 @@ describe("startNewVoiceBroadcastRecording", () => {
|
|||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
describe("when trying to start a broadcast if there is no connection", () => {
|
||||
beforeEach(async () => {
|
||||
mocked(client.getSyncState).mockReturnValue(SyncState.Error);
|
||||
result = await startNewVoiceBroadcastRecording(room, client, playbacksStore, recordingsStore);
|
||||
});
|
||||
|
||||
it("should show an info dialog and not start a recording", () => {
|
||||
expect(result).toBeNull();
|
||||
expect(Modal.createDialog).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when the current user is allowed to send voice broadcast info state events", () => {
|
||||
beforeEach(() => {
|
||||
mocked(room.currentState.maySendStateEvent).mockReturnValue(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue