@@ -638,6 +638,64 @@ describe("ToolsTab", () => {
638
638
} ) ;
639
639
} ) ;
640
640
641
+ describe ( "Enum Parameters" , ( ) => {
642
+ const toolWithEnumParam : Tool = {
643
+ name : "enumTool" ,
644
+ description : "Tool with enum parameter" ,
645
+ inputSchema : {
646
+ type : "object" as const ,
647
+ properties : {
648
+ format : {
649
+ type : "string" as const ,
650
+ enum : [ "json" , "xml" , "csv" , "yaml" ] ,
651
+ description : "Output format" ,
652
+ } ,
653
+ } ,
654
+ } ,
655
+ } ;
656
+
657
+ beforeEach ( ( ) => {
658
+ // Mock scrollIntoView for Radix UI Select
659
+ Element . prototype . scrollIntoView = jest . fn ( ) ;
660
+ } ) ;
661
+
662
+ it ( "should render enum parameter as dropdown" , ( ) => {
663
+ renderToolsTab ( {
664
+ tools : [ toolWithEnumParam ] ,
665
+ selectedTool : toolWithEnumParam ,
666
+ } ) ;
667
+
668
+ // Should render a select button instead of textarea
669
+ const selectTrigger = screen . getByRole ( "combobox" , { name : / f o r m a t / i } ) ;
670
+ expect ( selectTrigger ) . toBeInTheDocument ( ) ;
671
+ } ) ;
672
+
673
+ it ( "should render non-enum string parameter as textarea" , ( ) => {
674
+ const toolWithStringParam : Tool = {
675
+ name : "stringTool" ,
676
+ description : "Tool with regular string parameter" ,
677
+ inputSchema : {
678
+ type : "object" as const ,
679
+ properties : {
680
+ text : {
681
+ type : "string" as const ,
682
+ description : "Some text input" ,
683
+ } ,
684
+ } ,
685
+ } ,
686
+ } ;
687
+
688
+ renderToolsTab ( {
689
+ tools : [ toolWithStringParam ] ,
690
+ selectedTool : toolWithStringParam ,
691
+ } ) ;
692
+
693
+ // Should render textarea, not select
694
+ expect ( screen . queryByRole ( "combobox" ) ) . not . toBeInTheDocument ( ) ;
695
+ expect ( screen . getByRole ( "textbox" ) ) . toBeInTheDocument ( ) ;
696
+ } ) ;
697
+ } ) ;
698
+
641
699
describe ( "JSON Validation Integration" , ( ) => {
642
700
const toolWithJsonParams : Tool = {
643
701
name : "jsonTool" ,
0 commit comments