diff --git a/src/app/features/project/store/project.effects.spec.ts b/src/app/features/project/store/project.effects.spec.ts index 3dd712f21..0e030326f 100644 --- a/src/app/features/project/store/project.effects.spec.ts +++ b/src/app/features/project/store/project.effects.spec.ts @@ -26,8 +26,8 @@ describe('ProjectEffects', () => { const createConfigState = (): GlobalConfigState => ({ ...DEFAULT_GLOBAL_CONFIG, - misc: { - ...DEFAULT_GLOBAL_CONFIG.misc, + tasks: { + ...DEFAULT_GLOBAL_CONFIG.tasks, defaultProjectId: 'project-1', }, }); @@ -65,14 +65,14 @@ describe('ProjectEffects', () => { // Set up config where project-1 is the default globalConfigServiceMock.cfg.and.returnValue({ ...DEFAULT_GLOBAL_CONFIG, - misc: { - ...DEFAULT_GLOBAL_CONFIG.misc, + tasks: { + ...DEFAULT_GLOBAL_CONFIG.tasks, defaultProjectId: 'project-1', }, }); effects.deleteProjectRelatedData.subscribe(() => { - expect(globalConfigServiceMock.updateSection).toHaveBeenCalledWith('misc', { + expect(globalConfigServiceMock.updateSection).toHaveBeenCalledWith('tasks', { defaultProjectId: null, }); done(); @@ -91,8 +91,8 @@ describe('ProjectEffects', () => { // Set up config where project-1 is the default, but we delete project-2 globalConfigServiceMock.cfg.and.returnValue({ ...DEFAULT_GLOBAL_CONFIG, - misc: { - ...DEFAULT_GLOBAL_CONFIG.misc, + tasks: { + ...DEFAULT_GLOBAL_CONFIG.tasks, defaultProjectId: 'project-1', }, }); @@ -114,8 +114,8 @@ describe('ProjectEffects', () => { it('should NOT clear defaultProjectId when there is no default', (done) => { globalConfigServiceMock.cfg.and.returnValue({ ...DEFAULT_GLOBAL_CONFIG, - misc: { - ...DEFAULT_GLOBAL_CONFIG.misc, + tasks: { + ...DEFAULT_GLOBAL_CONFIG.tasks, defaultProjectId: null, }, }); diff --git a/src/app/features/tasks/store/task-internal.effects.spec.ts b/src/app/features/tasks/store/task-internal.effects.spec.ts index 25e10ea82..387be292b 100644 --- a/src/app/features/tasks/store/task-internal.effects.spec.ts +++ b/src/app/features/tasks/store/task-internal.effects.spec.ts @@ -8,13 +8,13 @@ import { setCurrentTask, toggleStart, unsetCurrentTask } from './task.actions'; import { selectTaskFeatureState } from './task.selectors'; import { selectConfigFeatureState, - selectMiscConfig, + selectTasksConfig, } from '../../config/store/global-config.reducer'; import { DEFAULT_TASK, Task, TaskState } from '../task.model'; import { WorkContextService } from '../../work-context/work-context.service'; import { LOCAL_ACTIONS } from '../../../util/local-actions.token'; import { DEFAULT_GLOBAL_CONFIG } from '../../config/default-global-config.const'; -import { GlobalConfigState, MiscConfig } from '../../config/global-config.model'; +import { GlobalConfigState, TasksConfig } from '../../config/global-config.model'; import { WorkContextType } from '../../work-context/work-context.model'; describe('TaskInternalEffects', () => { @@ -60,8 +60,8 @@ describe('TaskInternalEffects', () => { ...partial, }); - const createMiscConfig = (partial: Partial = {}): MiscConfig => ({ - ...DEFAULT_GLOBAL_CONFIG.misc, + const createTasksConfig = (partial: Partial = {}): TasksConfig => ({ + ...DEFAULT_GLOBAL_CONFIG.tasks, ...partial, }); @@ -91,8 +91,8 @@ describe('TaskInternalEffects', () => { provideMockStore({ selectors: [ { - selector: selectMiscConfig, - value: createMiscConfig({ isAutMarkParentAsDone: true }), + selector: selectTasksConfig, + value: createTasksConfig({ isAutoMarkParentAsDone: true }), }, { selector: selectTaskFeatureState, value: createTaskState([]) }, { selector: selectConfigFeatureState, value: createConfigState() }, @@ -129,8 +129,8 @@ describe('TaskInternalEffects', () => { }); store.overrideSelector( - selectMiscConfig, - createMiscConfig({ isAutMarkParentAsDone: true }), + selectTasksConfig, + createTasksConfig({ isAutoMarkParentAsDone: true }), ); store.overrideSelector( selectTaskFeatureState, @@ -164,8 +164,8 @@ describe('TaskInternalEffects', () => { }); store.overrideSelector( - selectMiscConfig, - createMiscConfig({ isAutMarkParentAsDone: false }), + selectTasksConfig, + createTasksConfig({ isAutoMarkParentAsDone: false }), ); store.overrideSelector( selectTaskFeatureState, @@ -205,8 +205,8 @@ describe('TaskInternalEffects', () => { }); store.overrideSelector( - selectMiscConfig, - createMiscConfig({ isAutMarkParentAsDone: true }), + selectTasksConfig, + createTasksConfig({ isAutoMarkParentAsDone: true }), ); store.overrideSelector( selectTaskFeatureState, diff --git a/src/app/features/tasks/task.service.spec.ts b/src/app/features/tasks/task.service.spec.ts index 0cea248f9..bce6fb6fe 100644 --- a/src/app/features/tasks/task.service.spec.ts +++ b/src/app/features/tasks/task.service.spec.ts @@ -105,11 +105,12 @@ describe('TaskService', () => { const globalConfigServiceSpy = jasmine.createSpyObj('GlobalConfigService', [''], { cfg: signal({ - misc: { defaultProjectId: null }, + tasks: { defaultProjectId: null }, reminder: { defaultTaskRemindOption: 'AT_START' }, appFeatures: { isTimeTrackingEnabled: true }, }), misc: signal({ isShowProductivityTipLonger: false }), + tasks: signal({ defaultProjectId: null }), }); const taskFocusServiceSpy = jasmine.createSpyObj('TaskFocusService', [''], {