Fix masquerade button i18n key references

Changed platform.masquerade to platform.masquerade.label since the
translation key is now a nested object with multiple properties.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-21 23:47:13 -05:00
parent 18eeda62e8
commit 33e07fe64f
3 changed files with 5 additions and 5 deletions

View File

@@ -113,7 +113,7 @@ const PlatformBusinesses: React.FC<PlatformBusinessesProps> = ({ onMasquerade })
<button
onClick={() => handleLoginAs(business)}
className="text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-300 font-medium text-xs inline-flex items-center gap-1 px-3 py-1 border border-indigo-200 dark:border-indigo-800 rounded-lg hover:bg-indigo-50 dark:hover:bg-indigo-900/30 transition-colors"
title={t('platform.masqueradeAs') + ' ' + business.owner.email}
title={t('platform.masquerade.masqueradeAs') + ' ' + business.owner.email}
>
<Eye size={14} />
{t('common.masquerade')}

View File

@@ -104,7 +104,7 @@ const PlatformUsers: React.FC<PlatformUsersProps> = ({ onMasquerade }) => {
disabled={u.is_superuser}
title={u.is_superuser ? 'Cannot masquerade as superuser' : `Masquerade as ${u.name || u.username}`}
>
<Eye size={14} /> {t('platform.masquerade')}
<Eye size={14} /> {t('platform.masquerade.label')}
</button>
<button
onClick={() => setEditingUser(u)}

View File

@@ -439,14 +439,14 @@ describe('PlatformUsers', () => {
it('should show masquerade button for each user', () => {
render(<PlatformUsers onMasquerade={mockOnMasquerade} />, { wrapper: createWrapper() });
expect(screen.getByText('platform.masquerade')).toBeInTheDocument();
expect(screen.getByText('platform.masquerade.label')).toBeInTheDocument();
});
it('should call onMasquerade with user data when clicking masquerade button', async () => {
const user = userEvent.setup();
render(<PlatformUsers onMasquerade={mockOnMasquerade} />, { wrapper: createWrapper() });
const masqueradeButton = screen.getByText('platform.masquerade');
const masqueradeButton = screen.getByText('platform.masquerade.label');
await user.click(masqueradeButton);
expect(mockOnMasquerade).toHaveBeenCalledWith({
@@ -467,7 +467,7 @@ describe('PlatformUsers', () => {
render(<PlatformUsers onMasquerade={mockOnMasquerade} />, { wrapper: createWrapper() });
const masqueradeButton = screen.getByText('platform.masquerade');
const masqueradeButton = screen.getByText('platform.masquerade.label');
expect(masqueradeButton).toBeDisabled();
});
});