From ea20ecd8016d0ff75f09cda2e15691049e3cfa7f Mon Sep 17 00:00:00 2001 From: Nevio Di Gennaro Date: Thu, 23 Jan 2025 13:45:35 +0100 Subject: [PATCH] fix tests --- .../check-in-form-metric.component.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/checkin/check-in-form-metric/check-in-form-metric.component.spec.ts b/frontend/src/app/components/checkin/check-in-form-metric/check-in-form-metric.component.spec.ts index 62e0617b8b..452427d0d3 100644 --- a/frontend/src/app/components/checkin/check-in-form-metric/check-in-form-metric.component.spec.ts +++ b/frontend/src/app/components/checkin/check-in-form-metric/check-in-form-metric.component.spec.ts @@ -127,9 +127,10 @@ describe('CheckInFormComponent', () => { false] ])('should correctly validate value input', (value, validity) => { component.dialogForm = new FormGroup({ - metricValue: new FormControl('', [Validators.required]) + metricValue: new FormControl(undefined, [Validators.required, + Validators.pattern('^\\s*-?\\d+\\.?\\d*\\s*$')]) }); - component.dialogForm.setValue({ value: value }); + component.dialogForm.setValue({ metricValue: value }); expect(component.dialogForm.valid) .toEqual(validity); });