test(documents): add regression test for sort fallback to year grouping

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-20 11:21:45 +02:00
committed by marcel
parent e79da27a12
commit 2260c25dc5

View File

@@ -104,6 +104,20 @@ describe('DocumentList year grouping', () => {
});
});
// ─── Sort fallback ────────────────────────────────────────────────────────────
describe('DocumentList sort fallback', () => {
it('falls back to year grouping when sort is not SENDER or RECEIVER', async () => {
const items = [
makeItem({ document: { ...makeItem().document, id: '1', documentDate: '2024-03-15' } })
];
render(DocumentList, { ...baseProps, items, total: 1, sort: 'TITLE' });
await expect
.element(page.getByTestId('group-header').filter({ hasText: '2024' }))
.toBeInTheDocument();
});
});
// ─── Sender grouping ─────────────────────────────────────────────────────────
describe('DocumentList sender grouping', () => {