Skip to content

Commit 78c56b3

Browse files
committed
Fixed failing tests
1 parent 7624eef commit 78c56b3

File tree

2 files changed

+5
-27
lines changed

2 files changed

+5
-27
lines changed

client/src/components/ToolsTab.tsx

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@ const ToolsTab = ({
472472
)}
473473
<Button
474474
onClick={async () => {
475+
// Validate JSON inputs before calling tool
476+
if (checkValidationErrors()) return;
477+
475478
try {
476479
setIsToolRunning(true);
477480
const meta = metaEntries.reduce<Record<string, unknown>>(
@@ -490,7 +493,7 @@ const ToolsTab = ({
490493
setIsToolRunning(false);
491494
}
492495
}}
493-
disabled={isToolRunning}
496+
disabled={isToolRunning || hasValidationErrors}
494497
>
495498
{isToolRunning ? (
496499
<>
@@ -505,32 +508,6 @@ const ToolsTab = ({
505508
)}
506509
</Button>
507510
<div className="flex gap-2">
508-
<Button
509-
onClick={async () => {
510-
// Validate JSON inputs before calling tool
511-
if (checkValidationErrors()) return;
512-
513-
try {
514-
setIsToolRunning(true);
515-
await callTool(selectedTool.name, params);
516-
} finally {
517-
setIsToolRunning(false);
518-
}
519-
}}
520-
disabled={isToolRunning || hasValidationErrors}
521-
>
522-
{isToolRunning ? (
523-
<>
524-
<Loader2 className="w-4 h-4 mr-2 animate-spin" />
525-
Running...
526-
</>
527-
) : (
528-
<>
529-
<Send className="w-4 h-4 mr-2" />
530-
Run Tool
531-
</>
532-
)}
533-
</Button>
534511
<Button
535512
onClick={async () => {
536513
try {

client/src/components/__tests__/ToolsTab.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ describe("ToolsTab", () => {
835835
message: "test message",
836836
count: 5,
837837
},
838+
undefined,
838839
);
839840
});
840841

0 commit comments

Comments
 (0)