feat(#447): permission-gated reader dashboard #477

Merged
marcel merged 25 commits from worktree-feat+issue-447-reader-dashboard into main 2026-05-08 15:56:54 +02:00
2 changed files with 13 additions and 1 deletions
Showing only changes of commit fa269de4d3 - Show all commits

View File

@@ -12,7 +12,7 @@ interface Props {
const { documents }: Props = $props();
function isNew(doc: Document): boolean {
return doc.createdAt === doc.updatedAt;
return new Date(doc.createdAt).getTime() === new Date(doc.updatedAt).getTime();
}
</script>

View File

@@ -55,6 +55,18 @@ describe('ReaderRecentDocs', () => {
await expect.element(badge).not.toBeInTheDocument();
});
it('shows "Neu" badge when createdAt and updatedAt represent the same instant in different ISO formats', async () => {
const sameInstantDoc: Document = {
...baseDoc,
id: 'doc-same-instant',
createdAt: '2025-01-01T12:00:00Z',
updatedAt: '2025-01-01T12:00:00.000Z'
};
render(ReaderRecentDocs, { documents: [sameInstantDoc] });
const badge = page.getByText(/^Neu$/i);
await expect.element(badge).toBeInTheDocument();
});
it('renders sender link when sender is present', async () => {
const docWithSender: Document = {
...baseDoc,