mirror of
https://github.com/callumalpass/tasknotes.git
synced 2026-07-22 12:50:26 +00:00
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.
This commit is contained in:
parent
bc7ae802c6
commit
da854a0ff0
1 changed files with 2 additions and 2 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue