mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-17 16:37:43 +00:00
test: fix 4 failing unit tests after recent sync and dueDay changes
- Add TODAY_TAG to FAKE_ROOT_STATE in TaskArchiveService so handleUpdateTask can find it when marking tasks as done - Update dueDay assertion to expect defined value (set to today by updateDoneOnForTask) - Add mock tasks to LWW integration tests so orphan filter doesn't remove taskIds from PROJECT/TAG entities
This commit is contained in:
parent
b83c6be7fa
commit
7c30916d28
3 changed files with 14 additions and 5 deletions
|
|
@ -272,7 +272,7 @@ describe('TaskArchiveService', () => {
|
|||
|
||||
expect(updatedTask.isDone).toBe(true);
|
||||
expect(updatedTask.doneOn).toBeGreaterThan(0);
|
||||
expect(updatedTask.dueDay).toBeUndefined();
|
||||
expect(updatedTask.dueDay).toBeDefined();
|
||||
|
||||
// Mark as undone
|
||||
archiveDbAdapterMock.loadArchiveYoung.and.returnValue(
|
||||
|
|
|
|||
|
|
@ -13,9 +13,10 @@ import { ArchiveModel } from './archive.model';
|
|||
import { initialTimeTrackingState } from '../time-tracking/store/time-tracking.reducer';
|
||||
import { RootState } from '../../root-store/root-state';
|
||||
import { PROJECT_FEATURE_NAME } from '../project/store/project.reducer';
|
||||
import { TAG_FEATURE_NAME } from '../tag/store/tag.reducer';
|
||||
import { TAG_FEATURE_NAME, tagAdapter } from '../tag/store/tag.reducer';
|
||||
import { WORK_CONTEXT_FEATURE_NAME } from '../work-context/store/work-context.selectors';
|
||||
import { plannerFeatureKey } from '../planner/store/planner.reducer';
|
||||
import { TODAY_TAG } from '../tag/tag.const';
|
||||
|
||||
// Default empty archive
|
||||
const DEFAULT_ARCHIVE: ArchiveModel = {
|
||||
|
|
@ -28,7 +29,7 @@ const DEFAULT_ARCHIVE: ArchiveModel = {
|
|||
// Other feature states are empty as they're not needed for task updates
|
||||
const FAKE_ROOT_STATE: RootState = {
|
||||
[PROJECT_FEATURE_NAME]: { ids: [], entities: {} },
|
||||
[TAG_FEATURE_NAME]: { ids: [], entities: {} },
|
||||
[TAG_FEATURE_NAME]: tagAdapter.addOne(TODAY_TAG, tagAdapter.getInitialState()),
|
||||
[WORK_CONTEXT_FEATURE_NAME]: {
|
||||
activeId: 'xyz',
|
||||
activeType: 'TAG',
|
||||
|
|
|
|||
|
|
@ -168,8 +168,13 @@ describe('LWW Update Store Application Integration', () => {
|
|||
Action
|
||||
>;
|
||||
|
||||
// Include mock tasks so filterOrphanedTaskIdsFromEntityData doesn't remove them
|
||||
const initialState = createMockRootState(
|
||||
{},
|
||||
{
|
||||
task1: { id: 'task1', title: 'T1', notes: '', done: false, modified: 1000 },
|
||||
task2: { id: 'task2', title: 'T2', notes: '', done: false, modified: 1000 },
|
||||
task3: { id: 'task3', title: 'T3', notes: '', done: false, modified: 1000 },
|
||||
},
|
||||
{
|
||||
project1: {
|
||||
id: 'project1',
|
||||
|
|
@ -201,8 +206,11 @@ describe('LWW Update Store Application Integration', () => {
|
|||
Action
|
||||
>;
|
||||
|
||||
// Include mock task so filterOrphanedTaskIdsFromEntityData doesn't remove it
|
||||
const initialState = createMockRootState(
|
||||
{},
|
||||
{
|
||||
task1: { id: 'task1', title: 'T1', notes: '', done: false, modified: 1000 },
|
||||
},
|
||||
{},
|
||||
{
|
||||
tag1: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue