From 3bcc769ab72930d7f8304759e0b43a0d0d7f7302 Mon Sep 17 00:00:00 2001 From: Giannin Date: Fri, 15 Nov 2024 07:51:48 +0100 Subject: [PATCH] Fix unit tests --- .../check-in-form.component.spec.ts | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/frontend/src/app/components/checkin/check-in-form/check-in-form.component.spec.ts b/frontend/src/app/components/checkin/check-in-form/check-in-form.component.spec.ts index 10aeb6ad1b..0fb3fb5298 100644 --- a/frontend/src/app/components/checkin/check-in-form/check-in-form.component.spec.ts +++ b/frontend/src/app/components/checkin/check-in-form/check-in-form.component.spec.ts @@ -104,7 +104,7 @@ describe('CheckInFormComponent', () => { id: checkInMetric.id, version: checkInMetric.version, confidence: checkInMetric.confidence, - value: checkInMetric.value, + value: checkInMetric.value!.toString(), changeInfo: checkInMetric.changeInfo, initiatives: checkInMetric.initiatives, keyResultId: keyResultMetric.id, @@ -112,35 +112,6 @@ describe('CheckInFormComponent', () => { expect(actionServiceMock.updateActions).toHaveBeenCalled(); })); - it.each([ - ['HelloWorld200', 200], - ['200HelloWorld', 200], - ["200'000", 200000], - ['1050&%รง*', 1050], - ])('should parse value %s correctly to %s if key result is metric', (value: string, expected: number) => { - component.checkIn = checkInMetric; - component.keyResult = keyResultMetric; - component.dialogForm.controls['value'].setValue(value); - component.dialogForm.controls['confidence'].setValue(checkInMetric.confidence); - component.dialogForm.controls['changeInfo'].setValue(checkInMetric.changeInfo); - component.dialogForm.controls['initiatives'].setValue(checkInMetric.initiatives); - - checkInServiceMock.saveCheckIn.mockReturnValue(of(checkInMetric)); - actionServiceMock.updateActions.mockReturnValue(of(action2)); - component.saveCheckIn(); - - expect(checkInServiceMock.saveCheckIn).toHaveBeenCalledWith({ - id: checkInMetric.id, - version: checkInMetric.version, - confidence: checkInMetric.confidence, - value: expected, - changeInfo: checkInMetric.changeInfo, - initiatives: checkInMetric.initiatives, - keyResultId: keyResultMetric.id, - }); - expect(actionServiceMock.updateActions).toHaveBeenCalled(); - }); - it('should save check-in correctly if key result is ordinal', waitForAsync(async () => { component.checkIn = checkInOrdinal; component.keyResult = keyResultOrdinal;