Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/components/ToolsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ const ToolsTab = ({
<ChevronRight className="w-4 h-4 flex-shrink-0 text-gray-400 mt-1" />
</div>
)}
title="Tools"
title={tools.length > 0 ? `Tools (${tools.length})` : "Tools"}
buttonText={nextCursor ? "List More Tools" : "List Tools"}
isButtonDisabled={!nextCursor && tools.length > 0}
/>
Expand Down
14 changes: 14 additions & 0 deletions client/src/components/__tests__/ToolsTab.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down