fix(dashboard): retarget feed footer to /chronik + render rollup rows

- "Alle anzeigen" link now goes to /chronik (was /documents — the dead-end
  bug called out in #285).
- Rollup rows (count > 1) render a primary-colored count badge plus a
  compound timestamp line: "14. Apr. · 14:02–14:32" (en-dash U+2013).
- Singleton rows render the existing "14. Apr. 2026" date line.
- BLOCK_REVIEWED now has a verb mapping (re-using the annotation verb until
  the spec pins a distinct copy).
- Three new spec cases: rollup count badge + en-dash range, no badge on
  singletons, /chronik link assertion.

Part of #285.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-20 17:06:33 +02:00
committed by marcel
parent 661eedd29c
commit 81f86474b6
2 changed files with 60 additions and 4 deletions

View File

@@ -17,7 +17,8 @@ const baseItem: ActivityFeedItemDTO = {
documentId: 'doc-1',
documentTitle: 'Brief 1920',
happenedAt: '2026-04-19T10:00:00Z',
youMentioned: false
youMentioned: false,
count: 1
};
describe('DashboardActivityFeed', () => {
@@ -39,4 +40,30 @@ describe('DashboardActivityFeed', () => {
const section = page.getByText('Kommentare & Aktivität');
await expect.element(section).toBeInTheDocument();
});
it('renders count badge and en-dash time range for rollup rows (count > 1)', async () => {
const rollup: ActivityFeedItemDTO = {
...baseItem,
count: 20,
happenedAtUntil: '2026-04-19T10:32:00Z'
};
render(DashboardActivityFeed, { feed: [rollup] });
const badge = page.getByTestId('feed-rollup-count');
await expect.element(badge).toHaveTextContent('20');
// "" is U+2013 en-dash
const stamp = page.getByText(/\u2013/);
await expect.element(stamp).toBeInTheDocument();
});
it('does not render count badge for singleton rows (count === 1)', async () => {
render(DashboardActivityFeed, { feed: [baseItem] });
const badge = page.getByTestId('feed-rollup-count');
await expect.element(badge).not.toBeInTheDocument();
});
it('links the "show all" footer to /chronik, not /documents', async () => {
render(DashboardActivityFeed, { feed: [] });
const link = page.getByRole('link', { name: /alle anzeigen/i });
await expect.element(link).toHaveAttribute('href', '/chronik');
});
});