diff --git a/x-pack/plugins/ml/public/components/field_type_icon/__snapshots__/field_type_icon.test.js.snap b/x-pack/plugins/ml/public/components/field_type_icon/__snapshots__/field_type_icon.test.js.snap
index f8ff8dd752323..df9367578f0ca 100644
--- a/x-pack/plugins/ml/public/components/field_type_icon/__snapshots__/field_type_icon.test.js.snap
+++ b/x-pack/plugins/ml/public/components/field_type_icon/__snapshots__/field_type_icon.test.js.snap
@@ -2,7 +2,7 @@
exports[`FieldTypeIcon render component when type matches a field type 1`] = `
@@ -10,8 +10,8 @@ exports[`FieldTypeIcon render component when type matches a field type 1`] = `
exports[`FieldTypeIcon update component 1`] = `
`;
diff --git a/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon.js b/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon.js
index 33c2fda04edad..cf23fa1468f7d 100644
--- a/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon.js
+++ b/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon.js
@@ -20,31 +20,31 @@ export function FieldTypeIcon({ tooltipEnabled = false, type }) {
switch (type) {
case ML_JOB_FIELD_TYPES.BOOLEAN:
- ariaLabel = 'Boolean field';
+ ariaLabel = 'boolean type';
iconClass = 'fa-adjust';
break;
case ML_JOB_FIELD_TYPES.DATE:
- ariaLabel = 'Date field';
+ ariaLabel = 'date type';
iconClass = 'fa-clock-o';
break;
case ML_JOB_FIELD_TYPES.NUMBER:
- ariaLabel = 'Metric field';
+ ariaLabel = 'number type';
iconChar = '#';
break;
case ML_JOB_FIELD_TYPES.GEO_POINT:
- ariaLabel = 'Geo-point field';
+ ariaLabel = 'geo_point type';
iconClass = 'fa-globe';
break;
case ML_JOB_FIELD_TYPES.KEYWORD:
- ariaLabel = 'Aggregatable string field';
+ ariaLabel = 'keyword type';
iconChar = 't';
break;
case ML_JOB_FIELD_TYPES.TEXT:
- ariaLabel = 'String field';
+ ariaLabel = 'text type';
iconClass = 'fa-file-text-o';
break;
case ML_JOB_FIELD_TYPES.IP:
- ariaLabel = 'IP address field';
+ ariaLabel = 'IP type';
iconClass = 'fa-laptop';
break;
default:
@@ -69,7 +69,7 @@ export function FieldTypeIcon({ tooltipEnabled = false, type }) {
// to support having another component directly inside the tooltip anchor
// see https://github.com/elastic/eui/issues/839
return (
-
+
);
@@ -86,7 +86,7 @@ FieldTypeIcon.propTypes = {
// To pass on its properties we apply `rest` to the outer `span` element.
function FieldTypeIconContainer({ ariaLabel, className, iconChar, ...rest }) {
return (
-
+
{(iconChar === '') ? (
) : (
diff --git a/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon.test.js b/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon.test.js
index 74432ee964330..975319f942739 100644
--- a/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon.test.js
+++ b/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon.test.js
@@ -8,6 +8,7 @@ import { mount, shallow } from 'enzyme';
import React from 'react';
import { FieldTypeIcon } from './field_type_icon';
+import { ML_JOB_FIELD_TYPES } from '../../../common/constants/field_types';
describe('FieldTypeIcon', () => {
@@ -22,12 +23,12 @@ describe('FieldTypeIcon', () => {
});
test(`render component when type matches a field type`, () => {
- const wrapper = shallow();
+ const wrapper = shallow();
expect(wrapper).toMatchSnapshot();
});
test(`render with tooltip and test hovering`, () => {
- const wrapper = mount();
+ const wrapper = mount();
const container = wrapper.find({ className: 'field-type-icon-container' });
expect(wrapper.find('EuiToolTip').children()).toHaveLength(1);
@@ -42,7 +43,7 @@ describe('FieldTypeIcon', () => {
test(`update component`, () => {
const wrapper = shallow();
expect(wrapper.isEmptyRender()).toBeTruthy();
- wrapper.setProps({ type: 'keyword' });
+ wrapper.setProps({ type: ML_JOB_FIELD_TYPES.IP });
expect(wrapper).toMatchSnapshot();
});