From d12122f3db4585fbd318076066c3961e4f701c71 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 27 Jun 2025 00:25:07 -0400 Subject: [PATCH] ci: update button accessibility labels in AgentDetail tests --- .../Agents/__tests__/AgentDetail.spec.tsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/client/src/components/SidePanel/Agents/__tests__/AgentDetail.spec.tsx b/client/src/components/SidePanel/Agents/__tests__/AgentDetail.spec.tsx index 8efbc5b15f..364ac82aec 100644 --- a/client/src/components/SidePanel/Agents/__tests__/AgentDetail.spec.tsx +++ b/client/src/components/SidePanel/Agents/__tests__/AgentDetail.spec.tsx @@ -159,7 +159,7 @@ describe('AgentDetail', () => { it('should render 3-dot menu button', () => { renderWithProviders(); - const menuButton = screen.getByRole('button', { name: 'More options' }); + const menuButton = screen.getByRole('button', { name: 'com_agents_more_options' }); expect(menuButton).toBeInTheDocument(); expect(menuButton).toHaveAttribute('aria-haspopup', 'menu'); }); @@ -199,7 +199,7 @@ describe('AgentDetail', () => { const user = userEvent.setup(); renderWithProviders(); - const menuButton = screen.getByRole('button', { name: 'More options' }); + const menuButton = screen.getByRole('button', { name: 'com_agents_more_options' }); await user.click(menuButton); expect(screen.getByRole('button', { name: 'com_agents_copy_link' })).toBeInTheDocument(); @@ -210,7 +210,7 @@ describe('AgentDetail', () => { renderWithProviders(); // Open dropdown - const menuButton = screen.getByRole('button', { name: 'More options' }); + const menuButton = screen.getByRole('button', { name: 'com_agents_more_options' }); await user.click(menuButton); expect(screen.getByRole('button', { name: 'com_agents_copy_link' })).toBeInTheDocument(); @@ -231,7 +231,7 @@ describe('AgentDetail', () => { renderWithProviders(); // Open dropdown - const menuButton = screen.getByRole('button', { name: 'More options' }); + const menuButton = screen.getByRole('button', { name: 'com_agents_more_options' }); await user.click(menuButton); // Click copy link @@ -247,7 +247,7 @@ describe('AgentDetail', () => { await waitFor(() => { expect(mockShowToast).toHaveBeenCalledWith({ - message: 'Link copied', + message: 'com_agents_link_copied', }); }); @@ -266,7 +266,7 @@ describe('AgentDetail', () => { renderWithProviders(); // Open dropdown and click copy link - const menuButton = screen.getByRole('button', { name: 'More options' }); + const menuButton = screen.getByRole('button', { name: 'com_agents_more_options' }); await user.click(menuButton); const copyLinkButton = screen.getByRole('button', { name: 'com_agents_copy_link' }); @@ -299,16 +299,16 @@ describe('AgentDetail', () => { it('should have proper ARIA attributes', () => { renderWithProviders(); - const menuButton = screen.getByRole('button', { name: 'More options' }); + const menuButton = screen.getByRole('button', { name: 'com_agents_more_options' }); expect(menuButton).toHaveAttribute('aria-haspopup', 'menu'); - expect(menuButton).toHaveAttribute('aria-label', 'More options'); + expect(menuButton).toHaveAttribute('aria-label', 'com_agents_more_options'); }); it('should support keyboard navigation for dropdown', async () => { const user = userEvent.setup(); renderWithProviders(); - const menuButton = screen.getByRole('button', { name: 'More options' }); + const menuButton = screen.getByRole('button', { name: 'com_agents_more_options' }); // Focus and open with Enter key menuButton.focus(); @@ -321,7 +321,7 @@ describe('AgentDetail', () => { const user = userEvent.setup(); renderWithProviders(); - const menuButton = screen.getByRole('button', { name: 'More options' }); + const menuButton = screen.getByRole('button', { name: 'com_agents_more_options' }); await user.click(menuButton); const copyLinkButton = screen.getByRole('button', { name: 'com_agents_copy_link' });