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
Tweak voice broadcast live icon (#9576)
This commit is contained in:
@ -23,6 +23,7 @@ import { RelationsHelperEvent } from "../../../src/events/RelationsHelper";
|
||||
import { MediaEventHelper } from "../../../src/utils/MediaEventHelper";
|
||||
import {
|
||||
VoiceBroadcastInfoState,
|
||||
VoiceBroadcastLiveness,
|
||||
VoiceBroadcastPlayback,
|
||||
VoiceBroadcastPlaybackEvent,
|
||||
VoiceBroadcastPlaybackState,
|
||||
@ -76,6 +77,12 @@ describe("VoiceBroadcastPlayback", () => {
|
||||
});
|
||||
};
|
||||
|
||||
const itShouldHaveLiveness = (liveness: VoiceBroadcastLiveness): void => {
|
||||
it(`should have liveness ${liveness}`, () => {
|
||||
expect(playback.getLiveness()).toBe(liveness);
|
||||
});
|
||||
};
|
||||
|
||||
const startPlayback = () => {
|
||||
beforeEach(async () => {
|
||||
await playback.start();
|
||||
@ -187,6 +194,8 @@ describe("VoiceBroadcastPlayback", () => {
|
||||
describe("and calling start", () => {
|
||||
startPlayback();
|
||||
|
||||
itShouldHaveLiveness("grey");
|
||||
|
||||
it("should be in buffering state", () => {
|
||||
expect(playback.getState()).toBe(VoiceBroadcastPlaybackState.Buffering);
|
||||
});
|
||||
@ -223,6 +232,7 @@ describe("VoiceBroadcastPlayback", () => {
|
||||
});
|
||||
|
||||
itShouldSetTheStateTo(VoiceBroadcastPlaybackState.Playing);
|
||||
itShouldHaveLiveness("live");
|
||||
|
||||
it("should update the duration", () => {
|
||||
expect(playback.durationSeconds).toBe(2.3);
|
||||
|
Reference in New Issue
Block a user