diff --git a/src/app/(protected)/workorders/_components/list/filter-bar/wo-type-filter.tsx b/src/app/(protected)/workorders/_components/list/filter-bar/wo-type-filter.tsx index 10ec3a7b..bd9c66c6 100644 --- a/src/app/(protected)/workorders/_components/list/filter-bar/wo-type-filter.tsx +++ b/src/app/(protected)/workorders/_components/list/filter-bar/wo-type-filter.tsx @@ -13,6 +13,11 @@ type WoTypeFilterProps = { disabled?: boolean; }; +const TYPE_FILTER_MENU_LIST_PROPS = { + "aria-label": "Work order types", + "data-testid": "wo-type-filter-menu", +}; + function typeFilterLabel(selected: Set): string { if (selected.size === 0) return "All types"; if (selected.size === 1) { @@ -97,9 +102,7 @@ export function WoTypeFilter({ selected, onChange, disabled = false }: WoTypeFil paper: { className: "mt-1 w-[180px] rounded-lg border border-border p-1.5 shadow-md", }, - list: { - "aria-label": "Work order types", - }, + list: TYPE_FILTER_MENU_LIST_PROPS, }} > { expect(screen.getByRole("button", { name: /all types/i })).toBeEnabled(); const menu = await openTypeMenu(user, /all types/i); + expect(menu).toHaveAttribute("data-testid", "wo-type-filter-menu"); expect(within(menu).getByRole("menuitemcheckbox", { name: "PM" })).toBeInTheDocument(); expect(within(menu).getByRole("menuitemcheckbox", { name: "Reactive" })).toBeInTheDocument(); expect(within(menu).getByRole("menuitemcheckbox", { name: "Emergency" })).toBeInTheDocument();