Handle broadcast chunk errors (#9970)
* Use strings for broadcast playback states * Handle broadcast decode errors
This commit is contained in:
parent
60edb85a1a
commit
533b250bb6
10 changed files with 483 additions and 275 deletions
|
@ -28,7 +28,7 @@ import {
|
|||
VoiceBroadcastPlaybackEvent,
|
||||
VoiceBroadcastPlaybackState,
|
||||
} from "../../../../src/voice-broadcast";
|
||||
import { stubClient } from "../../../test-utils";
|
||||
import { filterConsole, stubClient } from "../../../test-utils";
|
||||
import { mkVoiceBroadcastInfoStateEvent } from "../../utils/test-utils";
|
||||
import dis from "../../../../src/dispatcher/dispatcher";
|
||||
import { Action } from "../../../../src/dispatcher/actions";
|
||||
|
@ -53,6 +53,11 @@ describe("VoiceBroadcastPlaybackBody", () => {
|
|||
let playback: VoiceBroadcastPlayback;
|
||||
let renderResult: RenderResult;
|
||||
|
||||
filterConsole(
|
||||
// expected for some tests
|
||||
"voice broadcast chunk event to skip to not found",
|
||||
);
|
||||
|
||||
beforeAll(() => {
|
||||
client = stubClient();
|
||||
mocked(client.relations).mockClear();
|
||||
|
@ -214,6 +219,17 @@ describe("VoiceBroadcastPlaybackBody", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("when rendering an error broadcast", () => {
|
||||
beforeEach(() => {
|
||||
mocked(playback.getState).mockReturnValue(VoiceBroadcastPlaybackState.Error);
|
||||
renderResult = render(<VoiceBroadcastPlaybackBody playback={playback} />);
|
||||
});
|
||||
|
||||
it("should render as expected", () => {
|
||||
expect(renderResult.container).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe.each([
|
||||
[VoiceBroadcastPlaybackState.Paused, "not-live"],
|
||||
[VoiceBroadcastPlaybackState.Playing, "live"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue