= ({ recording }) => {
+ const {
+ live,
+ sender,
+ room,
+ stopRecording,
+ } = useVoiceBroadcastRecording(recording);
+
+ return ;
+};
diff --git a/src/voice-broadcast/index.ts b/src/voice-broadcast/index.ts
index 2a3bb6573f..7262382b0c 100644
--- a/src/voice-broadcast/index.ts
+++ b/src/voice-broadcast/index.ts
@@ -27,15 +27,17 @@ export * from "./audio/VoiceBroadcastRecorder";
export * from "./components/VoiceBroadcastBody";
export * from "./components/atoms/LiveBadge";
export * from "./components/atoms/PlaybackControlButton";
+export * from "./components/atoms/StopButton";
export * from "./components/atoms/VoiceBroadcastHeader";
export * from "./components/molecules/VoiceBroadcastPlaybackBody";
export * from "./components/molecules/VoiceBroadcastRecordingBody";
+export * from "./components/molecules/VoiceBroadcastRecordingPip";
+export * from "./hooks/useVoiceBroadcastRecording";
export * from "./stores/VoiceBroadcastPlaybacksStore";
export * from "./stores/VoiceBroadcastRecordingsStore";
export * from "./utils/shouldDisplayAsVoiceBroadcastRecordingTile";
export * from "./utils/shouldDisplayAsVoiceBroadcastTile";
export * from "./utils/startNewVoiceBroadcastRecording";
-export * from "./hooks/useVoiceBroadcastRecording";
export const VoiceBroadcastInfoEventType = "io.element.voice_broadcast_info";
export const VoiceBroadcastChunkEventType = "io.element.voice_broadcast_chunk";
diff --git a/test/voice-broadcast/components/atoms/StopButton-test.tsx b/test/voice-broadcast/components/atoms/StopButton-test.tsx
new file mode 100644
index 0000000000..742844fca1
--- /dev/null
+++ b/test/voice-broadcast/components/atoms/StopButton-test.tsx
@@ -0,0 +1,45 @@
+/*
+Copyright 2022 The Matrix.org Foundation C.I.C.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+import React from "react";
+import { render, RenderResult } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+
+import { StopButton } from "../../../../src/voice-broadcast";
+
+describe("StopButton", () => {
+ let result: RenderResult;
+ let onClick: () => {};
+
+ beforeEach(() => {
+ onClick = jest.fn();
+ result = render();
+ });
+
+ it("should render as expected", () => {
+ expect(result.container).toMatchSnapshot();
+ });
+
+ describe("when clicking it", () => {
+ beforeEach(async () => {
+ await userEvent.click(result.getByLabelText("stop voice broadcast"));
+ });
+
+ it("should invoke the callback", () => {
+ expect(onClick).toHaveBeenCalled();
+ });
+ });
+});
diff --git a/test/voice-broadcast/components/atoms/__snapshots__/StopButton-test.tsx.snap b/test/voice-broadcast/components/atoms/__snapshots__/StopButton-test.tsx.snap
new file mode 100644
index 0000000000..ca5015a79a
--- /dev/null
+++ b/test/voice-broadcast/components/atoms/__snapshots__/StopButton-test.tsx.snap
@@ -0,0 +1,19 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`StopButton should render as expected 1`] = `
+
+`;
diff --git a/test/voice-broadcast/components/molecules/VoiceBroadcastRecordingPip-test.tsx b/test/voice-broadcast/components/molecules/VoiceBroadcastRecordingPip-test.tsx
new file mode 100644
index 0000000000..a25c1b605d
--- /dev/null
+++ b/test/voice-broadcast/components/molecules/VoiceBroadcastRecordingPip-test.tsx
@@ -0,0 +1,67 @@
+/*
+Copyright 2022 The Matrix.org Foundation C.I.C.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+//
+
+import React from "react";
+import { render, RenderResult } from "@testing-library/react";
+import { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix";
+
+import {
+ VoiceBroadcastInfoEventType,
+ VoiceBroadcastRecording,
+ VoiceBroadcastRecordingPip,
+} from "../../../../src/voice-broadcast";
+import { mkEvent, stubClient } from "../../../test-utils";
+
+// mock RoomAvatar, because it is doing too much fancy stuff
+jest.mock("../../../../src/components/views/avatars/RoomAvatar", () => ({
+ __esModule: true,
+ default: jest.fn().mockImplementation(({ room }) => {
+ return room avatar: { room.name }
;
+ }),
+}));
+
+describe("VoiceBroadcastRecordingPip", () => {
+ const userId = "@user:example.com";
+ const roomId = "!room:example.com";
+ let client: MatrixClient;
+ let infoEvent: MatrixEvent;
+ let recording: VoiceBroadcastRecording;
+
+ beforeAll(() => {
+ client = stubClient();
+ infoEvent = mkEvent({
+ event: true,
+ type: VoiceBroadcastInfoEventType,
+ content: {},
+ room: roomId,
+ user: userId,
+ });
+ recording = new VoiceBroadcastRecording(infoEvent, client);
+ });
+
+ describe("when rendering", () => {
+ let renderResult: RenderResult;
+
+ beforeEach(() => {
+ renderResult = render();
+ });
+
+ it("should create the expected result", () => {
+ expect(renderResult.container).toMatchSnapshot();
+ });
+ });
+});
diff --git a/test/voice-broadcast/components/molecules/__snapshots__/VoiceBroadcastRecordingPip-test.tsx.snap b/test/voice-broadcast/components/molecules/__snapshots__/VoiceBroadcastRecordingPip-test.tsx.snap
new file mode 100644
index 0000000000..7eec506e21
--- /dev/null
+++ b/test/voice-broadcast/components/molecules/__snapshots__/VoiceBroadcastRecordingPip-test.tsx.snap
@@ -0,0 +1,71 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`VoiceBroadcastRecordingPip when rendering should create the expected result 1`] = `
+
+`;