diff --git a/components/contacts/__tests__/contacts-ux-pim.test.tsx b/components/contacts/__tests__/contacts-ux-pim.test.tsx index de42bb5d7..c0dbef52c 100644 --- a/components/contacts/__tests__/contacts-ux-pim.test.tsx +++ b/components/contacts/__tests__/contacts-ux-pim.test.tsx @@ -45,6 +45,17 @@ describe('pim-19: standard words read as people say them', () => { }); }); +describe('pim-21: a long name in the contact header', () => { + it('wraps to two lines and shows the whole name on hover', () => { + const long = { ...anna, name: { full: 'Maximiliane Alexandra Friederike von Hohenzollern-Sigmaringen-Wittelsbach' } }; + render(); + const heading = screen.getByRole('heading', { level: 2 }); + expect(heading).toHaveAttribute('title', long.name.full); + expect(heading.className).toContain('line-clamp-2'); + expect(heading.className).not.toMatch(/\btruncate\b/); + }); +}); + describe('pim-26: the contact editor keeps rare fields under "More fields"', () => { it('collapses Gender, Calendar, Online services and Personal info when none has a value', () => { render(); diff --git a/components/contacts/contact-detail.tsx b/components/contacts/contact-detail.tsx index addc2d069..1537c9814 100644 --- a/components/contacts/contact-detail.tsx +++ b/components/contacts/contact-detail.tsx @@ -151,7 +151,8 @@ export function ContactDetail({ contact, onEdit, onDelete, onAddToGroup, onDupli
-

{name || "-"}

+ {/* A long name takes two lines, then ends in "…" with the whole name on hover. */} +

{name || "-"}

{hasNickname && (

“{nicknames.map(n => n.name).join(", ")}”

)}