`;
+exports[`VoiceBroadcastPlaybackBody when rendering a playing/live broadcast should render as expected 1`] = `
+
+`;
+
exports[`VoiceBroadcastPlaybackBody when rendering a stopped broadcast should render as expected 1`] = `
`;
+
+exports[`VoiceBroadcastPlaybackBody when rendering an error broadcast should render as expected 1`] = `
+
+
+
+
+
+ Unable to play this voice broadcast
+
+
+
+`;
diff --git a/test/voice-broadcast/components/molecules/__snapshots__/VoiceBroadcastSmallPlaybackBody-test.tsx.snap b/test/voice-broadcast/components/molecules/__snapshots__/VoiceBroadcastSmallPlaybackBody-test.tsx.snap
index 27ad4098a2..f0319c6e73 100644
--- a/test/voice-broadcast/components/molecules/__snapshots__/VoiceBroadcastSmallPlaybackBody-test.tsx.snap
+++ b/test/voice-broadcast/components/molecules/__snapshots__/VoiceBroadcastSmallPlaybackBody-test.tsx.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`
when rendering a { state: 0, liveness: 'not-live' }/%s broadcast should render as expected 1`] = `
+exports[`
when rendering a { state: 'pause', liveness: 'not-live' }/%s broadcast should render as expected 1`] = `
when rendering a { state: 0, livene
`;
-exports[`
when rendering a { state: 1, liveness: 'live' }/%s broadcast should render as expected 1`] = `
+exports[`
when rendering a { state: 'playing', liveness: 'live' }/%s broadcast should render as expected 1`] = `
{
});
};
- filterConsole("Starting load of AsyncWrapper for modal");
+ filterConsole(
+ "Starting load of AsyncWrapper for modal",
+ // expected for some tests
+ "Unable to load broadcast playback",
+ );
beforeEach(() => {
client = stubClient();
@@ -283,6 +287,35 @@ describe("VoiceBroadcastPlayback", () => {
expect(playback.durationSeconds).toEqual(6.5);
});
+ describe("and starting a playback with a broken chunk", () => {
+ beforeEach(async () => {
+ mocked(chunk2Playback.prepare).mockRejectedValue("Error decoding chunk");
+ await playback.start();
+ });
+
+ itShouldSetTheStateTo(VoiceBroadcastPlaybackState.Error);
+
+ it("start() should keep it in the error state)", async () => {
+ await playback.start();
+ expect(playback.getState()).toBe(VoiceBroadcastPlaybackState.Error);
+ });
+
+ it("stop() should keep it in the error state)", () => {
+ playback.stop();
+ expect(playback.getState()).toBe(VoiceBroadcastPlaybackState.Error);
+ });
+
+ it("toggle() should keep it in the error state)", async () => {
+ await playback.toggle();
+ expect(playback.getState()).toBe(VoiceBroadcastPlaybackState.Error);
+ });
+
+ it("pause() should keep it in the error state)", () => {
+ playback.pause();
+ expect(playback.getState()).toBe(VoiceBroadcastPlaybackState.Error);
+ });
+ });
+
describe("and an event with the same transaction Id occurs", () => {
beforeEach(() => {
room.addLiveEvents([chunk2BEvent]);