Skip to main content

Function: getRoles()

getRoles(container): Map<string, RoleInfo[]>

Defined in: role-helpers.ts:46

Collects all accessible roles and their widgets from a container.

Returns a Map where keys are role names (lowercase) and values are arrays of widgets with that role, including their accessible names.

Parameters

ParameterTypeDescription
containerContainerThe container to scan for roles

Returns

Map<string, RoleInfo[]>

Map of role names to arrays of RoleInfo

Example

import { getRoles } from "@gtkx/testing";

const roles = getRoles(container);
// Map {
// "button" => [{ widget: ..., name: "Submit" }, { widget: ..., name: "Cancel" }],
// "checkbox" => [{ widget: ..., name: "Remember me" }]
// }