mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
fix: update project and task configurations to use 'tasks' instead of 'misc' in tests
This commit is contained in:
parent
e8d5dff3b9
commit
773ca2514f
3 changed files with 23 additions and 22 deletions
|
|
@ -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,
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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', [''], {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue