diff --git a/frontend/src/components/household/HouseholdSwitcher.jsx b/frontend/src/components/household/HouseholdSwitcher.jsx
index 2f22683..d429937 100644
--- a/frontend/src/components/household/HouseholdSwitcher.jsx
+++ b/frontend/src/components/household/HouseholdSwitcher.jsx
@@ -105,9 +105,6 @@ export default function HouseholdSwitcher() {
onClick={() => handleSelect(household)}
>
{household.name}
- {household.id === activeHousehold.id && (
- ✓
- )}
{households.length > 1 && (
{
@@ -45,8 +45,8 @@ test("selected household stays active after refreshing on settings and home page
});
});
- await page.route("**/stores/household/*", async (route) => {
- const householdId = Number(route.request().url().split("/").pop());
+ await page.route("**/households/*/stores", async (route) => {
+ const householdId = Number(route.request().url().match(/households\/(\d+)\/stores/)?.[1]);
await route.fulfill({
status: 200,
contentType: "application/json",
@@ -56,7 +56,15 @@ test("selected household stays active after refreshing on settings and home page
});
});
- await page.route("**/households/*/stores/*/list/recent", async (route) => {
+ await page.route("**/households/*/locations/*/zones", async (route) => {
+ await route.fulfill({
+ status: 200,
+ contentType: "application/json",
+ body: JSON.stringify({ zones: [] }),
+ });
+ });
+
+ await page.route("**/households/*/locations/*/list/recent", async (route) => {
await route.fulfill({
status: 200,
contentType: "application/json",
@@ -64,7 +72,7 @@ test("selected household stays active after refreshing on settings and home page
});
});
- await page.route("**/households/*/stores/*/list", async (route) => {
+ await page.route("**/households/*/locations/*/list", async (route) => {
await route.fulfill({
status: 200,
contentType: "application/json",
@@ -84,8 +92,20 @@ test("selected household stays active after refreshing on settings and home page
await expect(page.getByRole("button", { name: "Alpha Home" })).toBeVisible();
- await page.getByRole("button", { name: "Alpha Home" }).click();
- await page.getByRole("button", { name: "Bravo Home" }).click();
+ const householdTrigger = page.locator(".household-switcher-toggle");
+ await expect(householdTrigger).toContainText("Alpha Home");
+ await householdTrigger.click();
+ const householdDropdown = page.locator(".household-switcher-dropdown");
+ await expect(householdDropdown).toBeVisible();
+ await expect(page.locator(".check-mark")).toHaveCount(0);
+
+ const triggerBox = await householdTrigger.boundingBox();
+ const dropdownBox = await householdDropdown.boundingBox();
+ expect(triggerBox).not.toBeNull();
+ expect(dropdownBox).not.toBeNull();
+ expect(Math.abs((dropdownBox?.x ?? 0) - (triggerBox?.x ?? 0))).toBeLessThan(1);
+
+ await page.getByRole("button", { name: "Bravo Home", exact: true }).click();
await expect(page.getByRole("button", { name: "Bravo Home" })).toBeVisible();
await expect.poll(() => page.evaluate(() => localStorage.getItem("activeHouseholdId"))).toBe("2");