fix: trim map message empty state
This commit is contained in:
parent
0580914516
commit
815cd1b37f
@ -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",
|
||||
<main className="location-map-workspace location-map-message-workspace">
|
||||
<section className="location-map-setup location-map-message-card" aria-live="polite">
|
||||
<h2>{status}</h2>
|
||||
<p className="location-map-state-message">{message}</p>
|
||||
{message ? <p className="location-map-state-message">{message}</p> : null}
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@ -344,7 +344,6 @@ export default function LocationMapManager() {
|
||||
return (
|
||||
<LocationMapMessageState
|
||||
status="Select Household"
|
||||
message="Select a household to manage maps."
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user