@@ -134,18 +134,6 @@ describe("NumberInput", () => {
134134 ) . not . toBeInTheDocument ( ) ;
135135 } ) ;
136136
137- // TODO(bug): The icon descriptions are not being applied.
138- it . skip ( "should handle custom icon descriptions" , ( ) => {
139- render ( NumberInput , {
140- props : { iconDescription : "Custom description" } ,
141- } ) ;
142-
143- const buttons = screen . getAllByRole ( "button" ) ;
144- for ( const button of buttons ) {
145- expect ( button ) . toHaveAttribute ( "title" , "Custom description" ) ;
146- }
147- } ) ;
148-
149137 it ( "should handle custom slots" , ( ) => {
150138 render ( NumberInputCustom ) ;
151139
@@ -316,16 +304,19 @@ describe("NumberInput", () => {
316304 ) . toBeInTheDocument ( ) ;
317305 } ) ;
318306
319- it ( "should use iconDescription as fallback for button labels" , ( ) => {
307+ it ( "should use translateWithId to customize button labels" , ( ) => {
320308 render ( NumberInput , {
321309 props : {
322- translateWithId : ( ) => "" ,
323- iconDescription : "Adjust value" ,
310+ translateWithId : ( id : string ) => {
311+ if ( id === "increment" ) return "Plus" ;
312+ if ( id === "decrement" ) return "Minus" ;
313+ return id ;
314+ } ,
324315 } ,
325316 } ) ;
326317
327- const buttons = screen . getAllByRole ( "button" , { name : "Adjust value " } ) ;
328- expect ( buttons ) . toHaveLength ( 2 ) ; // Both increment and decrement buttons
318+ expect ( screen . getByRole ( "button" , { name : "Plus " } ) ) . toBeInTheDocument ( ) ;
319+ expect ( screen . getByRole ( "button" , { name : "Minus" } ) ) . toBeInTheDocument ( ) ;
329320 } ) ;
330321
331322 it ( "should have translationIds constant" , ( ) => {
0 commit comments