Skip to content

Commit ef69c0d

Browse files
authored
Restore the accessibility role on call views (#29225)
This was mistakenly removed in a370a5c. You can tell it was unintentional because the 'role' variable was just left unused.
1 parent bc7fe25 commit ef69c0d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/components/views/voip/CallView.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const JoinCallView: FC<JoinCallViewProps> = ({ room, resizing, call, skipLobby,
5858
await Promise.all(calls.map(async (call) => await call.disconnect()));
5959
}, []);
6060
return (
61-
<div className="mx_CallView">
61+
<div className="mx_CallView" role={role}>
6262
<AppTile
6363
app={call.widget}
6464
room={room}

test/unit-tests/components/views/voip/CallView-test.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ describe("CallView", () => {
6969
client.reEmitter.stopReEmitting(room, [RoomStateEvent.Events]);
7070
});
7171

72-
const renderView = async (skipLobby = false): Promise<void> => {
73-
render(<CallView room={room} resizing={false} waitForCall={false} skipLobby={skipLobby} />);
72+
const renderView = async (skipLobby = false, role: string | undefined = undefined): Promise<void> => {
73+
render(<CallView room={room} resizing={false} waitForCall={false} skipLobby={skipLobby} role={role} />);
7474
await act(() => Promise.resolve()); // Let effects settle
7575
};
7676

@@ -96,6 +96,11 @@ describe("CallView", () => {
9696
WidgetMessagingStore.instance.stopMessaging(widget, room.roomId);
9797
});
9898

99+
it("accepts an accessibility role", async () => {
100+
await renderView(undefined, "main");
101+
screen.getByRole("main");
102+
});
103+
99104
it("calls clean on mount", async () => {
100105
const cleanSpy = jest.spyOn(call, "clean");
101106
await renderView();

0 commit comments

Comments
 (0)