diff --git a/src/app/(protected)/workorders/_components/list/table/cells/pm-type-picker-popover.tsx b/src/app/(protected)/workorders/_components/list/table/cells/pm-type-picker-popover.tsx index 1df4a262..8f7d75a6 100644 --- a/src/app/(protected)/workorders/_components/list/table/cells/pm-type-picker-popover.tsx +++ b/src/app/(protected)/workorders/_components/list/table/cells/pm-type-picker-popover.tsx @@ -39,7 +39,7 @@ export function PmTypePickerPopover({ autoFocus value={search} onChange={(e) => onSearchChange(e.target.value)} - placeholder="Search PM type…" + placeholder="Search service…" className="w-full rounded border border-border bg-[var(--color-bg-surface)] px-2 py-1 text-xs text-[var(--color-text-primary)] focus:outline-none" /> diff --git a/src/app/(protected)/workorders/_components/wizard/wizard-step-location-service-select.tsx b/src/app/(protected)/workorders/_components/wizard/wizard-step-location-service-select.tsx index 4b9889df..baadd66e 100644 --- a/src/app/(protected)/workorders/_components/wizard/wizard-step-location-service-select.tsx +++ b/src/app/(protected)/workorders/_components/wizard/wizard-step-location-service-select.tsx @@ -50,7 +50,7 @@ export function WizardStepLocationServiceSelect({ icon={ } - searchPlaceholder="Search PM type…" + searchPlaceholder="Search services…" options={services.map((s) => { const Icon = getPmTypeIcon(s.value); return { diff --git a/src/test/app/(protected)/workorders/service-picker-search-placeholder.test.tsx b/src/test/app/(protected)/workorders/service-picker-search-placeholder.test.tsx new file mode 100644 index 00000000..7a2d7fa1 --- /dev/null +++ b/src/test/app/(protected)/workorders/service-picker-search-placeholder.test.tsx @@ -0,0 +1,56 @@ +import { fireEvent, render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; +import { WizardStepLocationServiceSelect } from "@/app/(protected)/workorders/_components/wizard/wizard-step-location-service-select"; +import { PmTypePickerPopover } from "@/app/(protected)/workorders/_components/list/table/cells/pm-type-picker-popover"; +import { + EMPTY_WIZARD_DRAFT, + type WorkOrderWizardDraft, +} from "@/domain/work-orders/types/work-order-wizard"; + +describe("service picker search placeholder", () => { + it("uses a type-neutral search placeholder in the wizard service picker", () => { + const draft: WorkOrderWizardDraft = { ...EMPTY_WIZARD_DRAFT, pm: "" }; + + render( + , + ); + + fireEvent.click(screen.getByRole("button", { name: /select service/i })); + + expect(screen.getByPlaceholderText("Search services…")).toBeTruthy(); + expect(screen.queryByPlaceholderText("Search PM type…")).toBeNull(); + }); + + it("uses a type-neutral search placeholder in the table service picker popover", () => { + const anchor = document.createElement("button"); + + render( + , + ); + + expect(screen.getByPlaceholderText("Search service…")).toBeTruthy(); + expect(screen.queryByPlaceholderText("Search PM type…")).toBeNull(); + }); +});