Add labs setting to force small broadcast chunks (#9806)

This commit is contained in:
Michael Weimann 2022-12-23 14:45:26 +01:00 committed by GitHub
parent a1bc4b8e6b
commit a2777d3a03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 2 deletions

View file

@ -17,6 +17,9 @@ limitations under the License.
import { mocked } from "jest-mock";
import SdkConfig, { DEFAULTS } from "../../../src/SdkConfig";
import { SettingLevel } from "../../../src/settings/SettingLevel";
import { Features } from "../../../src/settings/Settings";
import SettingsStore from "../../../src/settings/SettingsStore";
import { getChunkLength } from "../../../src/voice-broadcast/utils/getChunkLength";
jest.mock("../../../src/SdkConfig");
@ -48,7 +51,7 @@ describe("getChunkLength", () => {
});
});
describe("if there are no defaults", () => {
describe("when there are no defaults", () => {
beforeEach(() => {
DEFAULTS.voice_broadcast = undefined;
});
@ -57,4 +60,14 @@ describe("getChunkLength", () => {
expect(getChunkLength()).toBe(120);
});
});
describe("when the Features.VoiceBroadcastForceSmallChunks is enabled", () => {
beforeEach(async () => {
await SettingsStore.setValue(Features.VoiceBroadcastForceSmallChunks, null, SettingLevel.DEVICE, true);
});
it("should return a chunk length of 15 seconds", () => {
expect(getChunkLength()).toBe(15);
});
});
});