Skip to content

Commit

Permalink
Restore the accessibility role on call views (#29225)
Browse files Browse the repository at this point in the history
This was mistakenly removed in a370a5c. You can tell it was unintentional because the 'role' variable was just left unused.
  • Loading branch information
robintown authored Feb 11, 2025
1 parent bc7fe25 commit ef69c0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/views/voip/CallView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const JoinCallView: FC<JoinCallViewProps> = ({ room, resizing, call, skipLobby,
await Promise.all(calls.map(async (call) => await call.disconnect()));
}, []);
return (
<div className="mx_CallView">
<div className="mx_CallView" role={role}>
<AppTile
app={call.widget}
room={room}
Expand Down
9 changes: 7 additions & 2 deletions test/unit-tests/components/views/voip/CallView-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ describe("CallView", () => {
client.reEmitter.stopReEmitting(room, [RoomStateEvent.Events]);
});

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

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

it("accepts an accessibility role", async () => {
await renderView(undefined, "main");
screen.getByRole("main");
});

it("calls clean on mount", async () => {
const cleanSpy = jest.spyOn(call, "clean");
await renderView();
Expand Down

0 comments on commit ef69c0d

Please sign in to comment.