Tweak voice broadcast live icon (#9576)

This commit is contained in:
Michael Weimann 2022-11-16 16:13:59 +01:00 committed by GitHub
parent 973513cc75
commit cf3c899dd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 262 additions and 73 deletions

View file

@ -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);