File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ getByRole(
2929    expanded?: boolean ,
3030    queryFallbacks?: boolean ,
3131    level?: number ,
32+     disabled?: boolean ,
3233    value?: {
3334      min?: number ,
3435      max?: number ,
@@ -444,3 +445,32 @@ You can query a specific element like this
444445``` js 
445446getByRole (' alertdialog' :  ' Your session is about to expire' 
446447``` 
448+ 
449+ ### ` disabled `  
450+ 
451+ You can filter the returned elements by their disabled state by setting
452+ ` disabled: true ` , ` disabled: false ` , ` aria-disabled: true `  or
453+ ` aria-disabled: false ` .
454+ 
455+ For example in
456+ 
457+ ``` html 
458+ <body >
459+   <button  disabled >disabled</button >
460+   <button  aria-disabled =" true" button >
461+   <button >normal</button >
462+ </body >
463+ ``` 
464+ 
465+ you can query a specific element(s) like this
466+ 
467+ ``` js 
468+ getAllByRole (' button' :  true })
469+ //  [
470+ //    <button disabled>disabled</button>,
471+ //    <button aria-disabled="true">aria-disabled</button>
472+ //  ]
473+ 
474+ getByRole (' button' :  false })
475+ //  <button>normal</button>
476+ ``` 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments