@@ -16,6 +16,16 @@ describe("ToolsTab", () => {
16
16
} ,
17
17
} ,
18
18
} ,
19
+ {
20
+ name : "tool3" ,
21
+ description : "Integer tool" ,
22
+ inputSchema : {
23
+ type : "object" as const ,
24
+ properties : {
25
+ count : { type : "integer" as const } ,
26
+ } ,
27
+ } ,
28
+ } ,
19
29
{
20
30
name : "tool2" ,
21
31
description : "Second tool" ,
@@ -69,4 +79,28 @@ describe("ToolsTab", () => {
69
79
const newInput = screen . getByRole ( "spinbutton" ) as HTMLInputElement ;
70
80
expect ( newInput . value ) . toBe ( "" ) ;
71
81
} ) ;
82
+
83
+ it ( "should handle integer type inputs" , ( ) => {
84
+ renderToolsTab ( {
85
+ selectedTool : mockTools [ 2 ] ,
86
+ } ) ;
87
+
88
+ // Verify input is rendered as a number input
89
+ const input = screen . getByRole ( "spinbutton" ) as HTMLInputElement ;
90
+ expect ( input . type ) . toBe ( "text" ) ; // This will fail - should be "number"
91
+
92
+ // Enter an integer value
93
+ fireEvent . change ( input , { target : { value : "42" } } ) ;
94
+ expect ( input . value ) . toBe ( "42" ) ;
95
+
96
+ // Verify the callTool function receives the value as a number
97
+ const submitButton = screen . getByRole ( "button" , { name : / s u b m i t / i } ) ;
98
+ fireEvent . click ( submitButton ) ;
99
+
100
+ expect ( defaultProps . callTool ) . toHaveBeenCalledWith (
101
+ mockTools [ 2 ] . name ,
102
+ { count : 42 } , // Should be number 42, not string "42"
103
+ expect . any ( Function )
104
+ ) ;
105
+ } ) ;
72
106
} ) ;
0 commit comments