Show time left for voice broadcast recordings (#9564)
This commit is contained in:
parent
962e8e0b23
commit
f6347d24ef
22 changed files with 469 additions and 145 deletions
|
@ -26,7 +26,19 @@ import {
|
|||
VoiceBroadcastRecorderEvent,
|
||||
} from "../../../src/voice-broadcast";
|
||||
|
||||
jest.mock("../../../src/audio/VoiceRecording");
|
||||
// mock VoiceRecording because it contains all the audio APIs
|
||||
jest.mock("../../../src/audio/VoiceRecording", () => ({
|
||||
VoiceRecording: jest.fn().mockReturnValue({
|
||||
disableMaxLength: jest.fn(),
|
||||
emit: jest.fn(),
|
||||
liveData: {
|
||||
onUpdate: jest.fn(),
|
||||
},
|
||||
start: jest.fn(),
|
||||
stop: jest.fn(),
|
||||
destroy: jest.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
describe("VoiceBroadcastRecorder", () => {
|
||||
describe("createVoiceBroadcastRecorder", () => {
|
||||
|
@ -46,7 +58,6 @@ describe("VoiceBroadcastRecorder", () => {
|
|||
|
||||
it("should return a VoiceBroadcastRecorder instance with targetChunkLength from config", () => {
|
||||
const voiceBroadcastRecorder = createVoiceBroadcastRecorder();
|
||||
expect(mocked(VoiceRecording).mock.instances[0].disableMaxLength).toHaveBeenCalled();
|
||||
expect(voiceBroadcastRecorder).toBeInstanceOf(VoiceBroadcastRecorder);
|
||||
expect(voiceBroadcastRecorder.targetChunkLength).toBe(1337);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue