diff --git a/x-pack/platform/plugins/shared/cases/public/components/observables/fields_config.test.ts b/x-pack/platform/plugins/shared/cases/public/components/observables/fields_config.test.ts index 348b5b1ca27b5..3d832cb63003d 100644 --- a/x-pack/platform/plugins/shared/cases/public/components/observables/fields_config.test.ts +++ b/x-pack/platform/plugins/shared/cases/public/components/observables/fields_config.test.ts @@ -75,6 +75,14 @@ describe('genericValidator', () => { } as Parameters[0]); expect(result).toBeUndefined(); }); + + it('should return undefined if the value contains dashes', () => { + const result = genericValidator({ + value: 'valid-value', + path: 'generic', + } as Parameters[0]); + expect(result).toBeUndefined(); + }); }); describe('domainValidator', () => { diff --git a/x-pack/platform/plugins/shared/cases/public/components/observables/fields_config.ts b/x-pack/platform/plugins/shared/cases/public/components/observables/fields_config.ts index b858bb1251bb2..ce196d8088044 100644 --- a/x-pack/platform/plugins/shared/cases/public/components/observables/fields_config.ts +++ b/x-pack/platform/plugins/shared/cases/public/components/observables/fields_config.ts @@ -28,7 +28,7 @@ export const normalizeValueType = (value: string): keyof typeof fieldsConfig.val }; const DOMAIN_REGEX = /^(?!-)[A-Za-z0-9-]{1,63}(? ({ code: 'ERR_NOT_STRING',