diff --git a/client/src/components/__tests__/ToolsTab.test.tsx b/client/src/components/__tests__/ToolsTab.test.tsx
new file mode 100644
index 0000000..2688b52
--- /dev/null
+++ b/client/src/components/__tests__/ToolsTab.test.tsx
@@ -0,0 +1,72 @@
+import { render, screen, fireEvent } from "@testing-library/react";
+import { describe, it, expect, jest } from "@jest/globals";
+import ToolsTab from "../ToolsTab";
+import { Tool } from "@modelcontextprotocol/sdk/types.js";
+import { Tabs } from "@/components/ui/tabs";
+
+describe("ToolsTab", () => {
+ const mockTools: Tool[] = [
+ {
+ name: "tool1",
+ description: "First tool",
+ inputSchema: {
+ type: "object" as const,
+ properties: {
+ num: { type: "number" as const }
+ }
+ }
+ },
+ {
+ name: "tool2",
+ description: "Second tool",
+ inputSchema: {
+ type: "object" as const,
+ properties: {
+ num: { type: "number" as const }
+ }
+ }
+ }
+ ];
+
+ const defaultProps = {
+ tools: mockTools,
+ listTools: jest.fn(),
+ clearTools: jest.fn(),
+ callTool: jest.fn(),
+ selectedTool: null,
+ setSelectedTool: jest.fn(),
+ toolResult: null,
+ nextCursor: "",
+ error: null
+ };
+
+ const renderToolsTab = (props = {}) => {
+ return render(
+
+
+
+ );
+ };
+
+ it("should reset input values when switching tools", () => {
+ const { rerender } = renderToolsTab({
+ selectedTool: mockTools[0]
+ });
+
+ // Enter a value in the first tool's input
+ const input = screen.getByRole("spinbutton") as HTMLInputElement;
+ fireEvent.change(input, { target: { value: "42" } });
+ expect(input.value).toBe("42");
+
+ // Switch to second tool
+ rerender(
+
+
+
+ );
+
+ // Verify input is reset
+ const newInput = screen.getByRole("spinbutton") as HTMLInputElement;
+ expect(newInput.value).toBe("");
+ });
+});