From 815cd1b37f0d00b5435af699bf49c8256aff2d23 Mon Sep 17 00:00:00 2001 From: Nico Date: Wed, 17 Jun 2026 10:36:26 -0700 Subject: [PATCH] fix: trim map message empty state --- frontend/src/components/maps/LocationMapStateViews.jsx | 4 ++-- frontend/src/pages/LocationMapManager.jsx | 1 - frontend/tests/location-map-manager.spec.ts | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/maps/LocationMapStateViews.jsx b/frontend/src/components/maps/LocationMapStateViews.jsx index f45addf..cb9817f 100644 --- a/frontend/src/components/maps/LocationMapStateViews.jsx +++ b/frontend/src/components/maps/LocationMapStateViews.jsx @@ -1,6 +1,6 @@ import LocationMapTopbar from "./LocationMapTopbar"; -export function LocationMapMessageState({ message, location, status = "Loading", onBack }) { +export function LocationMapMessageState({ message = "", location, status = "Loading", onBack }) { const showTopbar = Boolean(location && onBack); return ( @@ -11,7 +11,7 @@ export function LocationMapMessageState({ message, location, status = "Loading",

{status}

-

{message}

+ {message ?

{message}

: null}
diff --git a/frontend/src/pages/LocationMapManager.jsx b/frontend/src/pages/LocationMapManager.jsx index a815dd9..a98dc13 100644 --- a/frontend/src/pages/LocationMapManager.jsx +++ b/frontend/src/pages/LocationMapManager.jsx @@ -344,7 +344,6 @@ export default function LocationMapManager() { return ( ); } diff --git a/frontend/tests/location-map-manager.spec.ts b/frontend/tests/location-map-manager.spec.ts index 94c947c..02253e2 100644 --- a/frontend/tests/location-map-manager.spec.ts +++ b/frontend/tests/location-map-manager.spec.ts @@ -481,8 +481,8 @@ test("map message prompts for a household with compact direct text", async ({ pa await expect(page.getByRole("heading", { name: "Select Household" })).toBeVisible(); const messageCard = page.locator(".location-map-message-card"); - await expect(messageCard.getByText("Select a household to manage maps.")).toBeVisible(); - await expect(messageCard.locator(".location-map-state-message")).toHaveText("Select a household to manage maps."); + await expect(messageCard.getByText("Select a household to manage maps.")).toHaveCount(0); + await expect(messageCard.locator(".location-map-state-message")).toHaveCount(0); await expect(messageCard.getByRole("group", { name: "Map message details" })).toHaveCount(0); await expect(messageCard.locator(".location-map-setup-row", { hasText: "Message" })).toHaveCount(0); await expect(messageCard.locator(".location-map-setup-row", { hasText: "Status" })).toHaveCount(0);