feat/issue-283-sender-receiver-grouping #284

Merged
marcel merged 8 commits from feat/issue-283-sender-receiver-grouping into main 2026-04-20 11:29:34 +02:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit a62ccd428b - Show all commits

View File

@@ -32,7 +32,7 @@ const groups = $derived.by(() => {
function groupByYear(docItems: DocumentSearchItem[]) {
const map = new SvelteMap<string, DocumentSearchItem[]>();
for (const item of docItems) {
const label = item.document.documentDate?.substring(0, 4) ?? 'Ohne Datum';
const label = item.document.documentDate?.substring(0, 4) ?? m.docs_group_undated();
const bucket = map.get(label);
if (bucket) bucket.push(item);
else map.set(label, [item]);

View File

@@ -84,12 +84,12 @@ describe('DocumentList year grouping', () => {
await expect.element(groupCards.nth(1)).toBeInTheDocument();
});
it('uses Ohne Datum for items with no documentDate', async () => {
it('uses undated label for items with no documentDate', async () => {
const items = [
makeItem({ document: { ...makeItem().document, id: '1', documentDate: undefined } })
];
render(DocumentList, { ...baseProps, items, total: 1 });
await expect.element(page.getByText('Ohne Datum')).toBeInTheDocument();
await expect.element(page.getByText('Undatiert')).toBeInTheDocument();
});
it('single year renders one group-card', async () => {