From 3e04a7c39a6b9edeaaaca69c8ca577c5fb88a384 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Thu, 10 Jul 2025 11:46:42 +0200 Subject: [PATCH] test: fix --- src/app/pfapi/api/util/vector-clock.spec.ts | 14 +++++++------- .../input-duration-formly.component.spec.ts | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/pfapi/api/util/vector-clock.spec.ts b/src/app/pfapi/api/util/vector-clock.spec.ts index 796c3dfab4..b5812a82ff 100644 --- a/src/app/pfapi/api/util/vector-clock.spec.ts +++ b/src/app/pfapi/api/util/vector-clock.spec.ts @@ -46,9 +46,9 @@ describe('Vector Clock', () => { }); describe('compareVectorClocks', () => { - it('should return EQUAL for two empty clocks', () => { - expect(compareVectorClocks({}, {})).toBe(VectorClockComparison.EQUAL); - expect(compareVectorClocks(null, null)).toBe(VectorClockComparison.EQUAL); + it('should return CONCURRENT for two empty clocks', () => { + expect(compareVectorClocks({}, {})).toBe(VectorClockComparison.CONCURRENT); + expect(compareVectorClocks(null, null)).toBe(VectorClockComparison.CONCURRENT); }); it('should return EQUAL for identical clocks', () => { @@ -85,8 +85,8 @@ describe('Vector Clock', () => { it('should handle comparison with empty clock', () => { const clock1 = { client1: 1 }; - expect(compareVectorClocks(clock1, {})).toBe(VectorClockComparison.GREATER_THAN); - expect(compareVectorClocks({}, clock1)).toBe(VectorClockComparison.LESS_THAN); + expect(compareVectorClocks(clock1, {})).toBe(VectorClockComparison.CONCURRENT); + expect(compareVectorClocks({}, clock1)).toBe(VectorClockComparison.CONCURRENT); }); }); @@ -198,8 +198,8 @@ describe('Vector Clock', () => { it('should handle empty current clock', () => { const reference = { client1: 5 }; - expect(hasVectorClockChanges({}, reference)).toBe(false); - expect(hasVectorClockChanges(null, reference)).toBe(false); + expect(hasVectorClockChanges({}, reference)).toBe(true); + expect(hasVectorClockChanges(null, reference)).toBe(true); }); it('should handle empty reference clock', () => { diff --git a/src/app/ui/duration/input-duration-formly/input-duration-formly.component.spec.ts b/src/app/ui/duration/input-duration-formly/input-duration-formly.component.spec.ts index ae89348534..23a74d2728 100644 --- a/src/app/ui/duration/input-duration-formly/input-duration-formly.component.spec.ts +++ b/src/app/ui/duration/input-duration-formly/input-duration-formly.component.spec.ts @@ -108,7 +108,7 @@ describe('InputDurationFormlyComponent', () => { }, 0); }); - it('should handle empty input and set null', (done) => { + it('should handle empty input and set undefined', (done) => { const event = { target: { value: '', @@ -118,7 +118,7 @@ describe('InputDurationFormlyComponent', () => { component.onInputValueChange(event); setTimeout(() => { - expect(setValueSpy).toHaveBeenCalledWith(null); + expect(setValueSpy).toHaveBeenCalledWith(undefined); done(); }, 0); });