test: revert MUI-specific vendor assertion workaround

This commit is contained in:
cawestall 2026-09-23 01:34:26 -03:00
parent 4475579e52
commit 3f843e95cf

View file

@ -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(<AddressFormHarness onValid={vi.fn()} />, { 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();
});
});