From e5068820fabaee0b0ee5fc94f2dee99c3fe8b531 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 20 Apr 2026 11:12:27 +0200 Subject: [PATCH] refactor(documents): rename year-card testid to group-card Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/routes/DocumentList.svelte | 2 +- .../src/routes/DocumentList.svelte.spec.ts | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/frontend/src/routes/DocumentList.svelte b/frontend/src/routes/DocumentList.svelte index 3cab1866..825136b2 100644 --- a/frontend/src/routes/DocumentList.svelte +++ b/frontend/src/routes/DocumentList.svelte @@ -103,7 +103,7 @@ function groupByReceiver(docItems: DocumentSearchItem[]) { {#each groups as group (group.label)}
diff --git a/frontend/src/routes/DocumentList.svelte.spec.ts b/frontend/src/routes/DocumentList.svelte.spec.ts index e787e176..9aba3bb6 100644 --- a/frontend/src/routes/DocumentList.svelte.spec.ts +++ b/frontend/src/routes/DocumentList.svelte.spec.ts @@ -79,9 +79,9 @@ describe('DocumentList – year grouping', () => { makeItem({ document: { ...makeItem().document, id: '2', documentDate: '1965-08-03' } }) ]; render(DocumentList, { ...baseProps, items, total: 2 }); - const yearCards = page.getByTestId('year-card'); - await expect.element(yearCards.first()).toBeInTheDocument(); - await expect.element(yearCards.nth(1)).toBeInTheDocument(); + const groupCards = page.getByTestId('group-card'); + await expect.element(groupCards.first()).toBeInTheDocument(); + await expect.element(groupCards.nth(1)).toBeInTheDocument(); }); it('uses Ohne Datum for items with no documentDate', async () => { @@ -92,16 +92,15 @@ describe('DocumentList – year grouping', () => { await expect.element(page.getByText('Ohne Datum')).toBeInTheDocument(); }); - it('single year renders one year-card', async () => { + it('single year renders one group-card', async () => { const items = [ makeItem({ document: { ...makeItem().document, id: '1', documentDate: '1938-01-01' } }), makeItem({ document: { ...makeItem().document, id: '2', documentDate: '1938-06-15' } }) ]; render(DocumentList, { ...baseProps, items, total: 2 }); - const yearCards = page.getByTestId('year-card'); - // Only one card for 1938 - await expect.element(yearCards.first()).toBeInTheDocument(); - await expect.element(yearCards.nth(1)).not.toBeInTheDocument(); + const groupCards = page.getByTestId('group-card'); + await expect.element(groupCards.first()).toBeInTheDocument(); + await expect.element(groupCards.nth(1)).not.toBeInTheDocument(); }); }); @@ -156,7 +155,7 @@ describe('DocumentList – sender grouping', () => { makeItem({ document: { ...makeItem().document, id: '2', sender } }) ]; render(DocumentList, { ...baseProps, items, total: 2, sort: 'SENDER' }); - const cards = page.getByTestId('year-card'); + const cards = page.getByTestId('group-card'); await expect.element(cards.first()).toBeInTheDocument(); await expect.element(cards.nth(1)).not.toBeInTheDocument(); }); @@ -210,7 +209,7 @@ describe('DocumentList – receiver grouping', () => { await expect .element(page.getByTestId('group-header').filter({ hasText: 'Hans Meier' })) .toBeInTheDocument(); - const cards = page.getByTestId('year-card'); + const cards = page.getByTestId('group-card'); await expect.element(cards.nth(1)).toBeInTheDocument(); });