diff --git a/__tests__/components/features/sidebar/sidebar.test.tsx b/__tests__/components/features/sidebar/sidebar.test.tsx index e26af87e1f..aaf36421ca 100644 --- a/__tests__/components/features/sidebar/sidebar.test.tsx +++ b/__tests__/components/features/sidebar/sidebar.test.tsx @@ -67,14 +67,15 @@ vi.mock("#/components/features/backends/backend-selector", () => ({ })); vi.mock("#/components/features/sidebar/sidebar-conversation-list", () => ({ - SidebarConversationList: () =>
, + SidebarConversationList: () => ( +
+ ), })); vi.mock("#/hooks/use-settings-nav-items", () => ({ useSettingsNavItems: () => [], })); - function renderSidebar(currentPath: string) { const value: NavigationContextValue = { currentPath, @@ -101,7 +102,12 @@ describe("Sidebar", () => { window.localStorage.clear(); }); - it.each([["/conversations"], ["/automations"], ["/automations/abc-123"], ["/settings"]])( + it.each([ + ["/conversations"], + ["/automations"], + ["/automations/abc-123"], + ["/settings"], + ])( "keeps the sidebar's default top padding on %s so spacing stays consistent with the conversations page", (currentPath) => { renderSidebar(currentPath); @@ -122,6 +128,17 @@ describe("Sidebar", () => { expect(settingsToggle.className).toMatch(/(^|\s)text-\[#8C8C8C\](\s|$)/); }); + it("labels the MCP nav item as MCP Directory instead of Integrations", () => { + renderSidebar("/mcp"); + + expect(screen.getByRole("link", { name: "SIDEBAR$MCP_DIRECTORY" })).toBe( + screen.getByTestId("sidebar-mcp-link"), + ); + expect( + screen.queryByRole("link", { name: "SIDEBAR$INTEGRATIONS" }), + ).not.toBeInTheDocument(); + }); + it("toggles between expanded and collapsed states and persists the choice", () => { const { unmount } = renderSidebar("/conversations"); @@ -170,6 +187,7 @@ describe("Sidebar", () => { "sidebar-conversations-link", "sidebar-automations-link", "sidebar-skills-link", + "sidebar-mcp-link", "sidebar-settings-toggle", ]) { const link = screen.getByTestId(testId); diff --git a/__tests__/i18n/sidebar-mcp-directory-label.test.ts b/__tests__/i18n/sidebar-mcp-directory-label.test.ts new file mode 100644 index 0000000000..5b4e6f064c --- /dev/null +++ b/__tests__/i18n/sidebar-mcp-directory-label.test.ts @@ -0,0 +1,21 @@ +import fs from "fs"; +import path from "path"; +import { describe, expect, it } from "vitest"; + +// The sidebar MCP entry must not use the ambiguous "Integrations" label. +// Lock this down at translation.json because the test i18next mock returns keys. +describe("SIDEBAR$MCP_DIRECTORY label", () => { + const translationPath = path.join( + __dirname, + "../../src/i18n/translation.json", + ); + const translation = JSON.parse( + fs.readFileSync(translationPath, "utf-8"), + ) as Record>; + + it('uses "MCP Directory" (not "Integrations") in English', () => { + expect(translation.SIDEBAR$MCP_DIRECTORY).toBeDefined(); + expect(translation.SIDEBAR$MCP_DIRECTORY.en).toBe("MCP Directory"); + expect(translation.SIDEBAR$MCP_DIRECTORY.en).not.toBe("Integrations"); + }); +}); diff --git a/src/components/features/sidebar/sidebar.tsx b/src/components/features/sidebar/sidebar.tsx index 44be944b47..4f299d12f8 100644 --- a/src/components/features/sidebar/sidebar.tsx +++ b/src/components/features/sidebar/sidebar.tsx @@ -229,7 +229,7 @@ export function Sidebar() { />