test(ui): update sidebar-customization e2e to current nav defaults (custodian in settings, advanced-tier search, plugin tabs in sidebar)

This commit is contained in:
Peter Steinberger
2026-07-22 22:56:25 -07:00
parent a12fba422c
commit d9c9dcf71e
+19 -13
View File
@@ -277,7 +277,7 @@ describeControlUiE2e("Control UI sidebar customization mocked Gateway E2E", () =
);
await expect
.poll(() => trimmedTextContents(pinnedItems))
.toEqual(["OpenClaw", "Usage", "Automations", "Plugins"]);
.toEqual(["Usage", "Automations", "Plugins"]);
await expect.poll(() => sidebar.locator(".sidebar-brand").count()).toBe(1);
// Desktop renders no topbar row: the sidebar owns navigation.
await expect.poll(() => page.locator(".topbar").isVisible()).toBe(false);
@@ -415,7 +415,9 @@ describeControlUiE2e("Control UI sidebar customization mocked Gateway E2E", () =
await expect.poll(() => browserResult.isVisible()).toBe(true);
await browserResult.click();
await expect.poll(() => new URL(page.url()).pathname).toBe("/settings/infrastructure");
await expect.poll(() => new URL(page.url()).search).toBe("?section=browser");
// Browser is an advanced-tier section (#112538): search navigation
// carries the advanced=1 reveal intent.
await expect.poll(() => new URL(page.url()).search).toBe("?section=browser&advanced=1");
await expect.poll(() => new URL(page.url()).hash).toBe("#config-section-browser");
await expect.poll(() => page.locator("#config-section-browser").isVisible()).toBe(true);
await captureSettingsSidebarProof(settingsSidebar, "01c-settings-search-deep-link.png");
@@ -458,7 +460,10 @@ describeControlUiE2e("Control UI sidebar customization mocked Gateway E2E", () =
await expect
.poll(() => page.locator(".shell").getAttribute("class"))
.not.toContain("shell--onboarding");
await expect.poll(() => sidebar.isVisible()).toBe(true);
// Ask OpenClaw is a settings-takeover page (#111686): the settings
// sidebar owns navigation there, not the app sidebar.
await expect.poll(() => settingsSidebar.isVisible()).toBe(true);
await expect.poll(() => sidebar.isVisible()).toBe(false);
await expect
.poll(() => page.getByRole("button", { name: "Exit setup" }).isVisible())
.toBe(false);
@@ -470,8 +475,13 @@ describeControlUiE2e("Control UI sidebar customization mocked Gateway E2E", () =
await expect.poll(() => moreButton.getAttribute("aria-expanded")).toBe("false");
await moreButton.click();
await expect.poll(() => moreButton.getAttribute("aria-expanded")).toBe("true");
// Enabled plugin tabs render directly in the sidebar body (#111995),
// not inside the More menu.
await expect
.poll(() => trimmedTextContents(moreMenu.getByRole("menuitem")))
.not.toContain("Logbook");
await expect
.poll(() => trimmedTextContents(sidebar.locator(".nav-item__text")))
.toContain("Logbook");
await expect.poll(() => trimmedTextContents(pinnedItems)).not.toContain("Logbook");
// Workboard ships disabled, so it stays hidden from navigation entirely.
@@ -490,17 +500,13 @@ describeControlUiE2e("Control UI sidebar customization mocked Gateway E2E", () =
.not.toContain("Workboard");
const tasksItem = menu.getByRole("menuitemcheckbox", { name: "Tasks" });
await expect.poll(() => tasksItem.getAttribute("aria-checked")).toBe("false");
const custodianItem = menu.getByRole("menuitemcheckbox", { name: "OpenClaw" });
await expect.poll(() => custodianItem.getAttribute("aria-checked")).toBe("true");
// Ask OpenClaw moved to Settings (#111686): custodian is not a sidebar
// nav route anymore, so the pin editor does not offer it.
await expect
.poll(() => custodianItem.evaluate((element) => element === document.activeElement))
.toBe(true);
.poll(() => menu.getByRole("menuitemcheckbox", { name: "OpenClaw" }).count())
.toBe(0);
await captureUiProof(page, "02-customize-menu.png");
await custodianItem.click();
await expect
.poll(() => trimmedTextContents(pinnedItems))
.toEqual(["Usage", "Automations", "Plugins"]);
await tasksItem.click();
await expect
.poll(() => trimmedTextContents(pinnedItems))
@@ -514,14 +520,14 @@ describeControlUiE2e("Control UI sidebar customization mocked Gateway E2E", () =
await moreButton.click();
await expect
.poll(() => trimmedTextContents(moreMenu.getByRole("menuitem")))
.toContain("OpenClaw");
.not.toContain("Tasks");
await captureUiProof(page, "03-persisted-customization.png");
await moreMenu.getByRole("menuitem", { name: "Edit pinned items" }).click();
await menu.getByRole("menuitem", { name: "Reset pinned items" }).click();
await expect
.poll(() => trimmedTextContents(pinnedItems))
.toEqual(["OpenClaw", "Usage", "Automations", "Plugins"]);
.toEqual(["Usage", "Automations", "Plugins"]);
// The sidebar search field is the command palette entry point.
const searchButton = sidebar.locator(".sidebar-search");