From 797a425f7f8116edcab4fe621135a9015fc1b5ff Mon Sep 17 00:00:00 2001 From: Rafal Szmit <40626242+rafalszmit@users.noreply.github.com> Date: Mon, 3 Oct 2022 11:57:21 +0200 Subject: [PATCH] [AAE-10729] form empty string regex validation unit test (#7870) * [AAE-10729] empty string regex validation * trigger travis --- .../widgets/core/form-field-validator.spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/core/src/lib/form/components/widgets/core/form-field-validator.spec.ts b/lib/core/src/lib/form/components/widgets/core/form-field-validator.spec.ts index fb50958f23..3ecbb46fb1 100644 --- a/lib/core/src/lib/form/components/widgets/core/form-field-validator.spec.ts +++ b/lib/core/src/lib/form/components/widgets/core/form-field-validator.spec.ts @@ -581,6 +581,16 @@ describe('FormFieldValidator', () => { expect(validator.validate(field)).toBeTruthy(); }); + it('should allow empty string values', () => { + const field = new FormFieldModel(new FormModel(), { + type: FormFieldTypes.TEXT, + value: '', + regexPattern: 'pattern' + }); + + expect(validator.validate(field)).toBeTruthy(); + }); + it('should succeed validating regex', () => { const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT,