fix: update project and task configurations to use 'tasks' instead of 'misc' in tests

This commit is contained in:
Ivan Kalashnikov 2026-01-19 01:04:59 +07:00
parent e8d5dff3b9
commit 773ca2514f
3 changed files with 23 additions and 22 deletions

View file

@ -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,
},
});

View file

@ -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> = {}): MiscConfig => ({
...DEFAULT_GLOBAL_CONFIG.misc,
const createTasksConfig = (partial: Partial<TasksConfig> = {}): 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,

View file

@ -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', [''], {