Remove the read-only "Originaltext" date field that confuses editors (#710) #712
@@ -113,7 +113,7 @@ function getFullName(person: Person): string {
|
||||
<div>
|
||||
<dt class="font-sans text-xs font-medium text-ink-3">{m.doc_details_field_date()}</dt>
|
||||
<dd class="text-ink">
|
||||
{#if documentDate || metaDateRaw}
|
||||
{#if documentDate}
|
||||
<DocumentDate
|
||||
iso={documentDate}
|
||||
precision={metaDatePrecision}
|
||||
|
||||
@@ -58,6 +58,18 @@ describe('DocumentMetadataDrawer', () => {
|
||||
expect(dashTexts.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('shows an em-dash and never the raw cell for an undated, raw-only document', async () => {
|
||||
render(DocumentMetadataDrawer, {
|
||||
props: { ...baseProps, documentDate: null, metaDateRaw: 'Sommer 1916' }
|
||||
});
|
||||
|
||||
await expect.element(page.getByText('Sommer 1916')).not.toBeInTheDocument();
|
||||
const dashTexts = Array.from(document.querySelectorAll('dd, p'))
|
||||
.map((el) => el.textContent?.trim())
|
||||
.filter((t) => t === '—');
|
||||
expect(dashTexts.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('renders the no-persons placeholder when sender and receivers are empty', async () => {
|
||||
render(DocumentMetadataDrawer, { props: baseProps });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user