Restore the accessibility role on call views (#29225)

This was mistakenly removed in a370a5cfa43. You can tell it was unintentional because the 'role' variable was just left unused.
This commit is contained in:
Robin 2025-02-11 15:28:29 +07:00 committed by GitHub
parent bc7fe25974
commit ef69c0ddc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -58,7 +58,7 @@ const JoinCallView: FC<JoinCallViewProps> = ({ room, resizing, call, skipLobby,
await Promise.all(calls.map(async (call) => await call.disconnect())); await Promise.all(calls.map(async (call) => await call.disconnect()));
}, []); }, []);
return ( return (
<div className="mx_CallView"> <div className="mx_CallView" role={role}>
<AppTile <AppTile
app={call.widget} app={call.widget}
room={room} room={room}

View File

@ -69,8 +69,8 @@ describe("CallView", () => {
client.reEmitter.stopReEmitting(room, [RoomStateEvent.Events]); client.reEmitter.stopReEmitting(room, [RoomStateEvent.Events]);
}); });
const renderView = async (skipLobby = false): Promise<void> => { const renderView = async (skipLobby = false, role: string | undefined = undefined): Promise<void> => {
render(<CallView room={room} resizing={false} waitForCall={false} skipLobby={skipLobby} />); render(<CallView room={room} resizing={false} waitForCall={false} skipLobby={skipLobby} role={role} />);
await act(() => Promise.resolve()); // Let effects settle await act(() => Promise.resolve()); // Let effects settle
}; };
@ -96,6 +96,11 @@ describe("CallView", () => {
WidgetMessagingStore.instance.stopMessaging(widget, room.roomId); 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 () => { it("calls clean on mount", async () => {
const cleanSpy = jest.spyOn(call, "clean"); const cleanSpy = jest.spyOn(call, "clean");
await renderView(); await renderView();