feat(documents): inline relationship pills next to person names
Replaces the standalone "Beziehung" badge at the bottom of the metadata drawer's Personen column with small inline pills attached to each personCard — sender gets labelFromA, the single receiver gets labelFromB. Matches docs/specs/stammbaum-doc-badge-spec.html. Drops the now-unused RelationshipBadge component. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -81,6 +81,25 @@ describe('DocumentMetadataDrawer — persons column', () => {
|
||||
renderDrawer({ sender: null, receivers: [] });
|
||||
await expect.element(page.getByText('Keine Personen zugeordnet')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders inferred relationship pills inline next to sender and receiver', async () => {
|
||||
renderDrawer({
|
||||
receivers: [receivers[0]],
|
||||
inferredRelationship: { labelFromA: 'Elternteil', labelFromB: 'Kind' }
|
||||
});
|
||||
|
||||
// Sender link contains its pill, receiver link contains its pill.
|
||||
const senderLink = page.getByRole('link', { name: /Karl Müller.*Elternteil/i });
|
||||
await expect.element(senderLink).toBeInTheDocument();
|
||||
const receiverLink = page.getByRole('link', { name: /Anna Schmidt.*Kind/i });
|
||||
await expect.element(receiverLink).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('omits the pills when no inferred relationship is provided', async () => {
|
||||
renderDrawer();
|
||||
const elternteil = page.getByText('Elternteil');
|
||||
expect(await elternteil.elements()).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
|
||||
// ─── Tags column ─────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user