diff --git a/src/ui/public/field_editor/components/field_format_editor/editors/bytes/bytes.test.js b/src/ui/public/field_editor/components/field_format_editor/editors/bytes/bytes.test.js index 09786c7758671..6c7e42f7f8fcc 100644 --- a/src/ui/public/field_editor/components/field_format_editor/editors/bytes/bytes.test.js +++ b/src/ui/public/field_editor/components/field_format_editor/editors/bytes/bytes.test.js @@ -34,6 +34,10 @@ const onChange = jest.fn(); const onError = jest.fn(); describe('BytesFormatEditor', () => { + it('should have a formatId', () => { + expect(BytesFormatEditor.formatId).toEqual('bytes'); + }); + it('should render normally', async () => { const component = shallow( `; -exports[`ColorFormatEditor should render other type normally (range field) 1`] = ` +exports[`ColorFormatEditorComponent should render other type normally (range field) 1`] = ` `; -exports[`ColorFormatEditor should render string type normally (regex field) 1`] = ` +exports[`ColorFormatEditorComponent should render string type normally (regex field) 1`] = ` { + it('should have a formatId', () => { + expect(ColorFormatEditor.formatId).toEqual('color'); + }); +}); + +describe('ColorFormatEditorComponent', () => { it('should render string type normally (regex field)', async () => { const component = shallowWithIntl( { + it('should have a formatId', () => { + expect(DateFormatEditor.formatId).toEqual('date'); + }); + it('should render normally', async () => { const component = shallow( { + it('should have a formatId', () => { + expect(DurationFormatEditor.formatId).toEqual('duration'); + }); + it('should render human readable output normally', async () => { const component = shallow( { + it('should have a formatId', () => { + expect(NumberFormatEditor.formatId).toEqual('number'); + }); + it('should render normally', async () => { const component = shallow( { + it('should have a formatId', () => { + expect(PercentFormatEditor.formatId).toEqual('percent'); + }); + it('should render normally', async () => { const component = shallow( `; -exports[`StaticLookupFormatEditor should render normally 1`] = ` +exports[`StaticLookupFormatEditorComponent should render normally 1`] = ` { const lookupEntries = [...this.props.formatParams.lookupEntries]; @@ -164,3 +163,4 @@ export class StaticLookupFormatEditorComponent extends DefaultFormatEditor { } export const StaticLookupFormatEditor = injectI18n(StaticLookupFormatEditorComponent); +StaticLookupFormatEditor.formatId = 'static_lookup'; diff --git a/src/ui/public/field_editor/components/field_format_editor/editors/static_lookup/static_lookup.test.js b/src/ui/public/field_editor/components/field_format_editor/editors/static_lookup/static_lookup.test.js index 6297179ed3011..59c54990cf4e2 100644 --- a/src/ui/public/field_editor/components/field_format_editor/editors/static_lookup/static_lookup.test.js +++ b/src/ui/public/field_editor/components/field_format_editor/editors/static_lookup/static_lookup.test.js @@ -20,7 +20,7 @@ import React from 'react'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { StaticLookupFormatEditorComponent } from './static_lookup'; +import { StaticLookupFormatEditor, StaticLookupFormatEditorComponent } from './static_lookup'; const fieldType = 'string'; const format = { @@ -33,8 +33,13 @@ const formatParams = { const onChange = jest.fn(); const onError = jest.fn(); - describe('StaticLookupFormatEditor', () => { + it('should have a formatId', () => { + expect(StaticLookupFormatEditor.formatId).toEqual('static_lookup'); + }); +}); + +describe('StaticLookupFormatEditorComponent', () => { it('should render normally', async () => { const component = shallowWithIntl( { + it('should have a formatId', () => { + expect(StringFormatEditor.formatId).toEqual('string'); + }); + it('should render normally', async () => { const component = shallow( { + it('should have a formatId', () => { + expect(TruncateFormatEditor.formatId).toEqual('truncate'); + }); + it('should render normally', async () => { const component = shallow( ({ describe('UrlFormatEditor', () => { + it('should have a formatId', () => { + expect(UrlFormatEditor.formatId).toEqual('url'); + }); + it('should render normally', async () => { const component = shallow(