mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-12 18:39:19 +00:00
feat(mute): add syncing state and disable toggle during async mute
This commit is contained in:
@@ -93,6 +93,27 @@ describe("MediaMuteAndSwitchButton", () => {
|
||||
expect(onMute).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test("disables mute button while busy", async () => {
|
||||
const user = userEvent.setup();
|
||||
const onMute = vi.fn();
|
||||
const { getByRole } = renderComponent(
|
||||
<MediaMuteAndSwitchButton
|
||||
title={"Switcher"}
|
||||
onMuteClick={onMute}
|
||||
iconsAndLabels="audio"
|
||||
enabled={true}
|
||||
busy={true}
|
||||
/>,
|
||||
);
|
||||
|
||||
const muteButton = getByRole("switch", { name: "Mute microphone" });
|
||||
expect(muteButton).toHaveAttribute("aria-disabled", "true");
|
||||
expect(muteButton).toHaveAttribute("aria-busy", "true");
|
||||
|
||||
await user.click(muteButton);
|
||||
expect(onMute).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test("requests device names when opened", async () => {
|
||||
const user = userEvent.setup();
|
||||
const requestDeviceNames = vi.fn();
|
||||
|
||||
Reference in New Issue
Block a user