Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enterprise Search] Fix SchemaFieldTypeSelect axe issues #100035

Merged
merged 2 commits into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export const SchemaTable: React.FC = () => {
<EuiTableHeader>
<EuiTableHeaderCell>{FIELD_NAME}</EuiTableHeaderCell>
<EuiTableHeaderCell aria-hidden />
<EuiTableHeaderCell align="right">{FIELD_TYPE}</EuiTableHeaderCell>
<EuiTableHeaderCell align="right" id="schemaFieldType">
{FIELD_TYPE}
</EuiTableHeaderCell>
</EuiTableHeader>
<EuiTableBody>
<EuiTableRow style={{ height: 56 }}>
Expand Down Expand Up @@ -74,6 +76,7 @@ export const SchemaTable: React.FC = () => {
fieldName={fieldName}
fieldType={fieldType}
updateExistingFieldType={updateSchemaFieldType}
aria-labelledby="schemaFieldType"
/>
</EuiTableRowCell>
</EuiTableRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ describe('SchemaFieldTypeSelect', () => {

expect(wrapper.find(EuiSelect).prop('disabled')).toEqual(true);
});

it('passes arbitrary props', () => {
const wrapper = shallow(<SchemaFieldTypeSelect {...props} disabled aria-label="Test label" />);

expect(wrapper.find(EuiSelect).prop('aria-label')).toEqual('Test label');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ export const SchemaFieldTypeSelect: React.FC<Props> = ({
fieldType,
updateExistingFieldType,
disabled,
...rest
}) => {
const fieldTypeOptions = Object.values(SchemaType).map((type) => ({ value: type, text: type }));
return (
<EuiSelect
{...rest}
name={fieldName}
required
value={fieldType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const SchemaFieldsTable: React.FC = () => {
<EuiTable tableLayout="auto">
<EuiTableHeader>
<EuiTableHeaderCell>{SCHEMA_ERRORS_TABLE_FIELD_NAME_HEADER}</EuiTableHeaderCell>
<EuiTableHeaderCell align="right">
<EuiTableHeaderCell align="right" id="schemaDataType">
{SCHEMA_ERRORS_TABLE_DATA_TYPE_HEADER}
</EuiTableHeaderCell>
</EuiTableHeader>
Expand All @@ -58,6 +58,7 @@ export const SchemaFieldsTable: React.FC = () => {
fieldName={fieldName}
fieldType={filteredSchemaFields[fieldName]}
updateExistingFieldType={updateExistingFieldType}
aria-labelledby="schemaDataType"
/>
</EuiTableRowCell>
</EuiTableRow>
Expand Down