Tweak voice broadcast live icon (#9576)
This commit is contained in:
parent
973513cc75
commit
cf3c899dd1
21 changed files with 262 additions and 73 deletions
|
@ -22,6 +22,7 @@ import { mocked } from "jest-mock";
|
|||
|
||||
import {
|
||||
VoiceBroadcastInfoState,
|
||||
VoiceBroadcastLiveness,
|
||||
VoiceBroadcastPlayback,
|
||||
VoiceBroadcastPlaybackBody,
|
||||
VoiceBroadcastPlaybackEvent,
|
||||
|
@ -62,6 +63,7 @@ describe("VoiceBroadcastPlaybackBody", () => {
|
|||
beforeEach(() => {
|
||||
playback = new VoiceBroadcastPlayback(infoEvent, client);
|
||||
jest.spyOn(playback, "toggle").mockImplementation(() => Promise.resolve());
|
||||
jest.spyOn(playback, "getLiveness");
|
||||
jest.spyOn(playback, "getState");
|
||||
jest.spyOn(playback, "durationSeconds", "get").mockReturnValue(23 * 60 + 42); // 23:42
|
||||
});
|
||||
|
@ -69,6 +71,7 @@ describe("VoiceBroadcastPlaybackBody", () => {
|
|||
describe("when rendering a buffering voice broadcast", () => {
|
||||
beforeEach(() => {
|
||||
mocked(playback.getState).mockReturnValue(VoiceBroadcastPlaybackState.Buffering);
|
||||
mocked(playback.getLiveness).mockReturnValue("live");
|
||||
renderResult = render(<VoiceBroadcastPlaybackBody playback={playback} />);
|
||||
});
|
||||
|
||||
|
@ -80,6 +83,7 @@ describe("VoiceBroadcastPlaybackBody", () => {
|
|||
describe(`when rendering a stopped broadcast`, () => {
|
||||
beforeEach(() => {
|
||||
mocked(playback.getState).mockReturnValue(VoiceBroadcastPlaybackState.Stopped);
|
||||
mocked(playback.getLiveness).mockReturnValue("not-live");
|
||||
renderResult = render(<VoiceBroadcastPlaybackBody playback={playback} />);
|
||||
});
|
||||
|
||||
|
@ -107,11 +111,12 @@ describe("VoiceBroadcastPlaybackBody", () => {
|
|||
});
|
||||
|
||||
describe.each([
|
||||
VoiceBroadcastPlaybackState.Paused,
|
||||
VoiceBroadcastPlaybackState.Playing,
|
||||
])("when rendering a %s broadcast", (playbackState: VoiceBroadcastPlaybackState) => {
|
||||
[VoiceBroadcastPlaybackState.Paused, "not-live"],
|
||||
[VoiceBroadcastPlaybackState.Playing, "live"],
|
||||
])("when rendering a %s/%s broadcast", (state: VoiceBroadcastPlaybackState, liveness: VoiceBroadcastLiveness) => {
|
||||
beforeEach(() => {
|
||||
mocked(playback.getState).mockReturnValue(playbackState);
|
||||
mocked(playback.getState).mockReturnValue(state);
|
||||
mocked(playback.getLiveness).mockReturnValue(liveness);
|
||||
renderResult = render(<VoiceBroadcastPlaybackBody playback={playback} />);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue