diff --git a/client/src/components/ToolsTab.tsx b/client/src/components/ToolsTab.tsx index 15b85fd67..fdf5cc64f 100644 --- a/client/src/components/ToolsTab.tsx +++ b/client/src/components/ToolsTab.tsx @@ -300,7 +300,7 @@ const ToolsTab = ({ )} - title="Tools" + title={tools.length > 0 ? `Tools (${tools.length})` : "Tools"} buttonText={nextCursor ? "List More Tools" : "List Tools"} isButtonDisabled={!nextCursor && tools.length > 0} /> diff --git a/client/src/components/__tests__/ToolsTab.test.tsx b/client/src/components/__tests__/ToolsTab.test.tsx index 5678914d6..468207854 100644 --- a/client/src/components/__tests__/ToolsTab.test.tsx +++ b/client/src/components/__tests__/ToolsTab.test.tsx @@ -84,6 +84,20 @@ describe("ToolsTab", () => { ); }; + it("should show the loaded tool count in the tools list title", () => { + renderToolsTab(); + + expect( + screen.getByRole("heading", { name: "Tools (4)" }), + ).toBeInTheDocument(); + }); + + it("should omit the tool count before tools are loaded", () => { + renderToolsTab({ tools: [] }); + + expect(screen.getByRole("heading", { name: "Tools" })).toBeInTheDocument(); + }); + it("should reset input values when switching tools", async () => { const { rerender } = renderToolsTab({ selectedTool: mockTools[0],