From da854a0ff0da1a0560a74d9b988fcf0cdab7cd63 Mon Sep 17 00:00:00 2001 From: callumalpass Date: Sun, 8 Feb 2026 11:41:38 +1100 Subject: [PATCH] test: fix TaskService test mock for addDTSTARTToRecurrenceRule The mock function signature was incorrect - it accepted a string but the actual function accepts a TaskInfo object. Updated the mock to match the real function signature and adjusted the test expectation to expect the DTSTART prefix in the recurrence output. --- tests/unit/services/TaskService.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/services/TaskService.test.ts b/tests/unit/services/TaskService.test.ts index ec0a9bfc..89395eec 100644 --- a/tests/unit/services/TaskService.test.ts +++ b/tests/unit/services/TaskService.test.ts @@ -37,7 +37,7 @@ jest.mock('../../../src/utils/helpers', () => ({ default: return undefined; } }), - addDTSTARTToRecurrenceRule: jest.fn((rule: string) => rule), + addDTSTARTToRecurrenceRule: jest.fn((task: { recurrence?: string }) => task.recurrence ? `DTSTART:20250110T120000Z;${task.recurrence}` : null), updateDTSTARTInRecurrenceRule: jest.fn((rule: string) => rule), updateToNextScheduledOccurrence: jest.fn(), splitFrontmatterAndBody: jest.fn(() => ({ frontmatter: {}, body: '' })) @@ -123,7 +123,7 @@ describe('TaskService', () => { scheduled: '2025-01-10', contexts: ['work', 'urgent'], timeEstimate: 120, - recurrence: 'FREQ=DAILY;INTERVAL=1' + recurrence: 'DTSTART:20250110T120000Z;FREQ=DAILY;INTERVAL=1' }); // With default tag-based identification, task tag should be included expect(taskInfo.tags).toContain('task');