Refactor screen share volume button into a component

This commit is contained in:
Robin
2026-03-06 23:14:15 +01:00
parent 5f2d1c8a7e
commit c7a16e9dfd
3 changed files with 88 additions and 132 deletions

View File

@@ -140,34 +140,3 @@ test("Screen share volume UI is hidden when screen share has no audio", async ()
screen.queryByRole("button", { name: /volume/i }),
).not.toBeInTheDocument();
});
test("Screen share volume UI is hidden in grid mode", async () => {
const vm = mockRemoteScreenShare(
mockRtcMembership("@alice:example.org", "AAAA"),
{},
mockRemoteParticipant({}),
);
vi.spyOn(vm, "audioEnabled$", "get").mockReturnValue(constant(true));
const { container } = render(
<TooltipProvider>
<SpotlightTile
vm={new SpotlightTileViewModel(constant([vm]), constant(false))}
targetWidth={300}
targetHeight={200}
expanded={false}
onToggleExpanded={null} // Grid mode
showIndicators
focusable
/>
</TooltipProvider>,
);
expect(await axe(container)).toHaveNoViolations();
// Volume menu button should not exist in grid mode
expect(
screen.queryByRole("button", { name: /volume/i }),
).not.toBeInTheDocument();
});