mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[Discover] Fix a11y description for the search input in fields sidebar (#150887)
Missed cleaning that up in https://github.com/elastic/kibana/pull/148547
This commit is contained in:
parent
cc82c49b0a
commit
0912777cfd
2 changed files with 13 additions and 4 deletions
|
@ -14,7 +14,6 @@ import {
|
|||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiPageSideBar_Deprecated as EuiPageSideBar,
|
||||
htmlIdGenerator,
|
||||
} from '@elastic/eui';
|
||||
import { isOfAggregateQueryType } from '@kbn/es-query';
|
||||
import { DataViewPicker } from '@kbn/unified-search-plugin/public';
|
||||
|
@ -45,8 +44,6 @@ import { getUiActions } from '../../../../kibana_services';
|
|||
import { getRawRecordType } from '../../utils/get_raw_record_type';
|
||||
import { RecordRawType } from '../../services/discover_data_state_container';
|
||||
|
||||
const fieldSearchDescriptionId = htmlIdGenerator()();
|
||||
|
||||
export interface DiscoverSidebarProps extends DiscoverSidebarResponsiveProps {
|
||||
/**
|
||||
* Show loading instead of the field list if processing
|
||||
|
@ -326,7 +323,6 @@ export function DiscoverSidebarComponent({
|
|||
<FieldListGrouped
|
||||
{...fieldListGroupedProps}
|
||||
renderFieldItem={renderFieldItem}
|
||||
screenReaderDescriptionId={fieldSearchDescriptionId}
|
||||
localStorageKeyPrefix="discover"
|
||||
/>
|
||||
) : (
|
||||
|
|
|
@ -290,6 +290,19 @@ describe('discover responsive sidebar', function () {
|
|||
expect(ExistingFieldsServiceApi.loadFieldExisting).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('should set a11y attributes for the search input in the field list', async function () {
|
||||
const comp = await mountComponent(props);
|
||||
|
||||
const a11yDescription = findTestSubject(comp, 'fieldListGrouped__ariaDescription');
|
||||
expect(a11yDescription.prop('aria-live')).toBe('polite');
|
||||
expect(a11yDescription.text()).toBe(
|
||||
'1 selected field. 4 popular fields. 3 available fields. 20 empty fields. 2 meta fields.'
|
||||
);
|
||||
|
||||
const searchInput = findTestSubject(comp, 'fieldListFiltersFieldSearch');
|
||||
expect(searchInput.first().prop('aria-describedby')).toBe(a11yDescription.prop('id'));
|
||||
});
|
||||
|
||||
it('should not have selected fields if no columns selected', async function () {
|
||||
const propsWithoutColumns = {
|
||||
...props,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue