You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-31 13:44:28 +03:00
Add labs setting to force small broadcast chunks (#9806)
This commit is contained in:
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user