From 80fd30fff9d0ace5eb1f886db8c15a1c82b08ebe Mon Sep 17 00:00:00 2001 From: Arthur Bassi Date: Thu, 20 Aug 2026 21:54:01 -0300 Subject: [PATCH] fix(work-orders): restore type filter e2e menu test id Put wo-type-filter-menu back on the MUI Menu list so the union journey can find type rows. --- .../_components/list/filter-bar/wo-type-filter.tsx | 9 ++++++--- .../app/(protected)/workorders/wo-type-filter.test.tsx | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) 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();