test(tag): add subtreeDocumentCount to admin tree fixtures (#698)
TagTreeNodeDTO now requires subtreeDocumentCount, so the admin sidebar test fixtures (TagTreeNode, TagsListPanel) need the field to type-check. The admin sidebar still renders the direct documentCount — these fixtures only gain the new field, no behaviour change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,7 @@ const leafNode = (overrides: Record<string, unknown> = {}) => ({
|
|||||||
name: 'Personen',
|
name: 'Personen',
|
||||||
color: 'sage',
|
color: 'sage',
|
||||||
documentCount: 5,
|
documentCount: 5,
|
||||||
|
subtreeDocumentCount: 5,
|
||||||
parentId: null,
|
parentId: null,
|
||||||
children: [],
|
children: [],
|
||||||
...overrides
|
...overrides
|
||||||
@@ -32,8 +33,18 @@ const parentNode = (overrides: Record<string, unknown> = {}) => ({
|
|||||||
name: 'Orte',
|
name: 'Orte',
|
||||||
color: 'sienna',
|
color: 'sienna',
|
||||||
documentCount: 0,
|
documentCount: 0,
|
||||||
|
subtreeDocumentCount: 2,
|
||||||
parentId: null,
|
parentId: null,
|
||||||
children: [{ id: 'tc1', name: 'Berlin', color: null, documentCount: 2, children: [] }],
|
children: [
|
||||||
|
{
|
||||||
|
id: 'tc1',
|
||||||
|
name: 'Berlin',
|
||||||
|
color: null,
|
||||||
|
documentCount: 2,
|
||||||
|
subtreeDocumentCount: 2,
|
||||||
|
children: []
|
||||||
|
}
|
||||||
|
],
|
||||||
...overrides
|
...overrides
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,18 @@ const tree = [
|
|||||||
name: 'Familie',
|
name: 'Familie',
|
||||||
color: undefined,
|
color: undefined,
|
||||||
documentCount: 3,
|
documentCount: 3,
|
||||||
|
subtreeDocumentCount: 5,
|
||||||
parentId: undefined,
|
parentId: undefined,
|
||||||
children: [
|
children: [
|
||||||
{ id: 't2', name: 'Eltern', color: undefined, documentCount: 2, parentId: 't1', children: [] }
|
{
|
||||||
|
id: 't2',
|
||||||
|
name: 'Eltern',
|
||||||
|
color: undefined,
|
||||||
|
documentCount: 2,
|
||||||
|
subtreeDocumentCount: 2,
|
||||||
|
parentId: 't1',
|
||||||
|
children: []
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -25,6 +34,7 @@ const tree = [
|
|||||||
name: 'Urlaub',
|
name: 'Urlaub',
|
||||||
color: 'teal',
|
color: 'teal',
|
||||||
documentCount: 0,
|
documentCount: 0,
|
||||||
|
subtreeDocumentCount: 0,
|
||||||
parentId: undefined,
|
parentId: undefined,
|
||||||
children: []
|
children: []
|
||||||
}
|
}
|
||||||
@@ -128,6 +138,7 @@ describe('TagsListPanel — color dot', () => {
|
|||||||
id: 't1',
|
id: 't1',
|
||||||
name: 'Familie',
|
name: 'Familie',
|
||||||
documentCount: 0,
|
documentCount: 0,
|
||||||
|
subtreeDocumentCount: 0,
|
||||||
parentId: undefined,
|
parentId: undefined,
|
||||||
children: [],
|
children: [],
|
||||||
color: undefined
|
color: undefined
|
||||||
|
|||||||
Reference in New Issue
Block a user