@@ -73,6 +73,8 @@ vi.mock("./proxy-groups-module-rules-panel", () => ({
7373
7474import { ProxyGroupsModuleCard } from "./proxy-groups-module-card" ;
7575
76+ type ModuleCardProps = React . ComponentProps < typeof ProxyGroupsModuleCard > ;
77+
7678const baseModule : ProxyGroupModule = {
7779 id : "gemini" ,
7880 name : "Gemini" ,
@@ -86,7 +88,7 @@ const baseModule: ProxyGroupModule = {
8688 ] ,
8789} ;
8890
89- function props ( overrides : Record < string , unknown > = { } ) {
91+ function props ( overrides : Partial < ModuleCardProps > = { } ) : ModuleCardProps {
9092 return {
9193 module : baseModule ,
9294 display : { full : "Gemini Display" } ,
@@ -183,10 +185,11 @@ describe("ProxyGroupsModuleCard", () => {
183185 } ) ;
184186
185187 it ( "handles optional description editing and advanced rule rendering" , ( ) => {
188+ const onChangeEditingDescription = vi . fn ( ) ;
186189 const editingHandlers = props ( {
187190 isEditing : true ,
188191 editingDescription : "Draft description" ,
189- onChangeEditingDescription : vi . fn ( ) ,
192+ onChangeEditingDescription,
190193 isRulesExpanded : false ,
191194 } ) ;
192195 renderToStaticMarkup ( React . createElement ( ProxyGroupsModuleCard , editingHandlers ) ) ;
@@ -200,16 +203,15 @@ describe("ProxyGroupsModuleCard", () => {
200203 descriptionInput . onChange ( { target : { value : "Updated description" } } ) ;
201204 descriptionInput . onKeyDown ( { key : "Enter" } ) ;
202205 descriptionInput . onKeyDown ( { key : "Escape" } ) ;
203- expect ( editingHandlers . onChangeEditingDescription ) . toHaveBeenCalledWith (
204- "Updated description" ,
205- ) ;
206+ expect ( onChangeEditingDescription ) . toHaveBeenCalledWith ( "Updated description" ) ;
206207 expect ( editingHandlers . onCommitEditing ) . toHaveBeenCalled ( ) ;
207208 expect ( editingHandlers . onCancelEditing ) . toHaveBeenCalled ( ) ;
208209
209210 mocks . inputs = [ ] ;
211+ const onChangeEmptyDescription = vi . fn ( ) ;
210212 const emptyDescriptionHandlers = props ( {
211213 isEditing : true ,
212- onChangeEditingDescription : vi . fn ( ) ,
214+ onChangeEditingDescription : onChangeEmptyDescription ,
213215 isRulesExpanded : false ,
214216 } ) ;
215217 renderToStaticMarkup (
@@ -284,7 +286,7 @@ describe("ProxyGroupsModuleCard", () => {
284286 ProxyGroupsModuleCard ,
285287 props ( {
286288 description : "Override description" ,
287- module : { ...baseModule , description : undefined } ,
289+ module : { ...baseModule , description : undefined as never } ,
288290 display : { full : "Override" } ,
289291 } )
290292 )
@@ -297,7 +299,7 @@ describe("ProxyGroupsModuleCard", () => {
297299 props ( {
298300 extraRules : [ ] ,
299301 manualRules : [ ] ,
300- module : { ...baseModule , description : undefined , rules : [ ] } ,
302+ module : { ...baseModule , description : undefined as never , rules : [ ] } ,
301303 rulesContentOverride : null ,
302304 rulesCountOverride : 0 ,
303305 } )
0 commit comments