diff --git a/src/app/features/task-repeat-cfg/store/task-repeat-cfg.reducer.spec.ts b/src/app/features/task-repeat-cfg/store/task-repeat-cfg.reducer.spec.ts index 08bec116abf..7e20fdeb2ac 100644 --- a/src/app/features/task-repeat-cfg/store/task-repeat-cfg.reducer.spec.ts +++ b/src/app/features/task-repeat-cfg/store/task-repeat-cfg.reducer.spec.ts @@ -24,6 +24,7 @@ const DUMMY_REPEATABLE_TASK: TaskRepeatCfg = { sunday: false, tagIds: [], order: 0, + subTaskIds: ['SUB_TASK__DEFAULT'], }; const HOUR = 60 * 60 * 1000; @@ -55,6 +56,23 @@ describe('selectTaskRepeatCfgsDueOnDay', () => { expect(resultIds).toEqual(['R1']); }); + it('should return cfg for a far future task WITH sub tasks', () => { + const result = selectTaskRepeatCfgsDueOnDay.projector( + [ + dummyRepeatable('R1', { + repeatCycle: 'DAILY', + startDate: '2022-01-10', + subTaskIds: ['ST-1', 'ST-2'], + }), + ], + { + dayDate: new Date('2025-11-11'), + }, + ); + const resultSubTaskIds = result.map((item) => item.subTaskIds); + expect(resultSubTaskIds).toEqual([['ST-1', 'ST-2']]); + }); + [ FAKE_MONDAY_THE_10TH, // eslint-disable-next-line no-mixed-operators diff --git a/src/app/features/task-repeat-cfg/task-repeat-cfg.model.ts b/src/app/features/task-repeat-cfg/task-repeat-cfg.model.ts index 844e6b48944..cf9a9cf9856 100644 --- a/src/app/features/task-repeat-cfg/task-repeat-cfg.model.ts +++ b/src/app/features/task-repeat-cfg/task-repeat-cfg.model.ts @@ -51,6 +51,7 @@ export interface TaskRepeatCfgCopy { // advanced notes: string | undefined; // ... possible sub tasks & attachments + subTaskIds: string[]; } export type TaskRepeatCfg = Readonly; @@ -87,4 +88,5 @@ export const DEFAULT_TASK_REPEAT_CFG: Omit = { order: 0, notes: undefined, + subTaskIds: [], };