mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-21 07:23:11 +00:00
fix: Align Agent Contact Email with Its Label
This commit is contained in:
parent
18a1ecfde9
commit
97bccd2e7d
2 changed files with 24 additions and 1 deletions
|
|
@ -59,7 +59,7 @@ export default function AgentContact({
|
|||
{contact?.email ? (
|
||||
<a
|
||||
href={`mailto:${contact.email}`}
|
||||
className="text-text-primary focus-visible:ring-text-primary inline-block max-w-full truncate rounded-sm py-1 hover:underline focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset"
|
||||
className="text-text-primary focus-visible:ring-text-primary block max-w-full truncate rounded-sm py-1 hover:underline focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset"
|
||||
>
|
||||
{label}
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -126,6 +126,29 @@ describe('Landing agent contact', () => {
|
|||
expect(screen.queryByRole('link', { name: 'Owner User' })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders the email link without inline baseline space beside the contact label', () => {
|
||||
mockConversation = {
|
||||
endpoint: 'agents',
|
||||
agent_id: 'agent-1',
|
||||
};
|
||||
mockAgentsMap = {
|
||||
'agent-1': {
|
||||
id: 'agent-1',
|
||||
name: 'LibreChat',
|
||||
description: 'Contact Danny if you see any errors',
|
||||
support_contact: { email: 'messagedaniel@pm.me' },
|
||||
},
|
||||
};
|
||||
|
||||
renderLanding();
|
||||
|
||||
const link = screen.getByRole('link', { name: 'messagedaniel@pm.me' });
|
||||
expect(link).toHaveAttribute('href', 'mailto:messagedaniel@pm.me');
|
||||
expect(link).toHaveClass('block');
|
||||
expect(link).not.toHaveClass('inline-block');
|
||||
expect(screen.getByText('Contact:').parentElement).toHaveClass('items-center');
|
||||
});
|
||||
|
||||
it('does not show contact when the selected agent is missing from agentsMap', () => {
|
||||
mockConversation = {
|
||||
endpoint: 'agents',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue