File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { render } from '@testing-library/react';
55import { DEBOUNCE_DEFAULT_DELAY } from '../../../lib/components/internal/debounce' ;
66import TextFilter , { TextFilterProps } from '../../../lib/components/text-filter' ;
77import createWrapper from '../../../lib/components/test-utils/dom' ;
8+ import '../../__a11y__/to-validate-a11y' ;
89
910function renderTextFilter ( jsx : React . ReactElement ) {
1011 const { container } = render ( jsx ) ;
@@ -106,3 +107,8 @@ describe('countText', () => {
106107 expect ( wrapper . findResultsCount ( ) . getElement ( ) . textContent ) . toEqual ( '10 matches' ) ;
107108 } ) ;
108109} ) ;
110+
111+ test ( 'check a11y' , async ( ) => {
112+ const { wrapper } = renderTextFilter ( < TextFilter filteringText = "" filteringAriaLabel = "filter instances" /> ) ;
113+ await expect ( wrapper . getElement ( ) ) . toValidateA11y ( ) ;
114+ } ) ;
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ const InternalTextFilter = React.forwardRef(
3333 const showResults = filteringText && countText && ! disabled ;
3434
3535 return (
36- < span { ...baseProps } className = { clsx ( baseProps . className , styles . root ) } ref = { __internalRootRef } >
36+ < div { ...baseProps } className = { clsx ( baseProps . className , styles . root ) } ref = { __internalRootRef } >
3737 < InternalInput
3838 ref = { inputRef }
3939 className = { styles . input }
@@ -53,7 +53,7 @@ const InternalTextFilter = React.forwardRef(
5353 >
5454 { showResults ? countText : '' }
5555 </ span >
56- </ span >
56+ </ div >
5757 ) ;
5858 }
5959) ;
You can’t perform that action at this time.
0 commit comments