Fix tests (accessibility issues with new buttons)
This commit is contained in:
@@ -54,6 +54,8 @@ test("can only interact with header and footer while reconnecting", async ({
|
|||||||
page.getByRole("switch", { name: "Mute microphone" }),
|
page.getByRole("switch", { name: "Mute microphone" }),
|
||||||
).toBeFocused();
|
).toBeFocused();
|
||||||
await page.keyboard.press("Tab");
|
await page.keyboard.press("Tab");
|
||||||
|
await expect(page.getByRole("button", { name: "Microphone" })).toBeFocused();
|
||||||
|
await page.keyboard.press("Tab");
|
||||||
await expect(page.getByRole("switch", { name: "Stop video" })).toBeFocused();
|
await expect(page.getByRole("switch", { name: "Stop video" })).toBeFocused();
|
||||||
// Most critically, we should be able to press the hangup button
|
// Most critically, we should be able to press the hangup button
|
||||||
await page.getByRole("button", { name: "End call" }).click();
|
await page.getByRole("button", { name: "End call" }).click();
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ export const MediaMuteAndSwitchButton: FC<MediaMuteAndSwitchButtonProps> = ({
|
|||||||
IconOptions: VideoCallIcon,
|
IconOptions: VideoCallIcon,
|
||||||
disabledLabel: t("stop_video_button_label"),
|
disabledLabel: t("stop_video_button_label"),
|
||||||
enabledLabel: t("start_video_button_label"),
|
enabledLabel: t("start_video_button_label"),
|
||||||
optionsButtonLabel: t("settings.devices.microphone"),
|
optionsButtonLabel: t("settings.devices.camera"),
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case "audio":
|
case "audio":
|
||||||
@@ -152,6 +152,7 @@ export const MediaMuteAndSwitchButton: FC<MediaMuteAndSwitchButtonProps> = ({
|
|||||||
{/* The mute button lives inside */}
|
{/* The mute button lives inside */}
|
||||||
<Button
|
<Button
|
||||||
iconOnly
|
iconOnly
|
||||||
|
role="switch"
|
||||||
Icon={enabled ? IconEnabled : IconDisabled}
|
Icon={enabled ? IconEnabled : IconDisabled}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
onMuteClick?.();
|
onMuteClick?.();
|
||||||
|
|||||||
Reference in New Issue
Block a user