diff --git a/src/test/app/(protected)/vendors/vendor-roster-address-fields.test.tsx b/src/test/app/(protected)/vendors/vendor-roster-address-fields.test.tsx index ed6c09a2..2a3bcc81 100644 --- a/src/test/app/(protected)/vendors/vendor-roster-address-fields.test.tsx +++ b/src/test/app/(protected)/vendors/vendor-roster-address-fields.test.tsx @@ -116,32 +116,18 @@ describe("VendorRosterFormFields address autocomplete", () => { }); describe("VendorRosterFormFields map preview empty state", () => { - const INCOMPLETE_PLACEHOLDER_TEXT = - "Map preview appears once Street, City, and State are all filled."; - - // MUI Autocomplete renders its own empty role="status" live region once the - // street combobox is interacted with, so the placeholder must be located by - // its SH-284 text among all status regions, never by any-status uniqueness. - function queryPlaceholderStatus(): HTMLElement | null { - return ( - screen - .queryAllByRole("status") - .find((status) => status.textContent?.includes(INCOMPLETE_PLACEHOLDER_TEXT)) ?? null - ); - } - it("shows the accessible placeholder while incomplete, then the map once complete", async () => { const user = userEvent.setup(); renderWithProviders(, { withAuth: false }); - expect(queryPlaceholderStatus()).toBeInTheDocument(); + expect(screen.getByRole("status")).toHaveTextContent(/street, city, and state/i); expect(screen.queryByTitle(/^Map of /)).not.toBeInTheDocument(); await user.type( screen.getByRole("combobox", { name: "Street Address (required)" }), TYPED_STREET, ); - expect(queryPlaceholderStatus()).toBeInTheDocument(); + expect(screen.getByRole("status")).toBeInTheDocument(); fireEvent.change(screen.getByRole("textbox", { name: "City (required)" }), { target: { value: "Theodore" }, @@ -149,6 +135,6 @@ describe("VendorRosterFormFields map preview empty state", () => { pickVendorState("AL"); expect(await screen.findByTitle(`Map of ${TYPED_STREET} Theodore AL`)).toBeInTheDocument(); - expect(queryPlaceholderStatus()).not.toBeInTheDocument(); + expect(screen.queryByRole("status")).not.toBeInTheDocument(); }); });