diff --git a/client/package.json b/client/package.json index 77640e9e3..77f23d843 100644 --- a/client/package.json +++ b/client/package.json @@ -101,6 +101,7 @@ "@fontsource/satisfy": "^5.3.0", "@fontsource/shrikhand": "^5.3.0", "@fontsource/yellowtail": "^5.3.0", + "@lucide/icons": "1.82.0", "@maplibre/maplibre-gl-leaflet": "0.1.4", "@noble/hashes": "^2.4.0", "@simplewebauthn/browser": "^14.0.0", diff --git a/client/src/components/Admin/AdminPluginsPanel.tsx b/client/src/components/Admin/AdminPluginsPanel.tsx index c1fdd3a54..2ad00c294 100644 --- a/client/src/components/Admin/AdminPluginsPanel.tsx +++ b/client/src/components/Admin/AdminPluginsPanel.tsx @@ -6,7 +6,6 @@ import { Globe, History, Puzzle, Bot, Loader2, } from 'lucide-react' import PluginIcon from '../shared/PluginIcon' -import { Github } from '../shared/legacyLucideIcons' import { useInstanceSettings } from './useInstanceSettings' import { type RangeWarning } from './useRangeBypass' import { deriveCaps } from './pluginCaps' @@ -790,7 +789,7 @@ function PluginDetailModal({ item, installed, busy, onInstall, onClose, t, local footer={( - + diff --git a/client/src/components/Admin/BackupPanel.test.tsx b/client/src/components/Admin/BackupPanel.test.tsx index 8b3025b0f..c4ef27daf 100644 --- a/client/src/components/Admin/BackupPanel.test.tsx +++ b/client/src/components/Admin/BackupPanel.test.tsx @@ -210,11 +210,8 @@ describe('BackupPanel', () => { await waitFor(() => { expect(screen.getByText('backup-2025-01-15.zip')).toBeInTheDocument() }) - const trashBtn = Array.from(document.querySelectorAll('button')).find( - b => b.querySelector('svg.lucide-trash2'), - ) as HTMLElement - expect(trashBtn).toBeTruthy() - await user.click(trashBtn!) + const trashBtn = screen.getByRole('button', { name: 'Delete' }) + await user.click(trashBtn) // The question is the shared confirm dialog now, not window.confirm expect(await screen.findByText('Delete backup "backup-2025-01-15.zip"?')).toBeInTheDocument() const deleteButtons = screen.getAllByRole('button', { name: 'Delete' }) @@ -428,9 +425,7 @@ describe('BackupPanel', () => { render(<>) await screen.findByText('backup-2025-01-15.zip') - const trashBtn = Array.from(document.querySelectorAll('button')).find( - b => b.querySelector('svg.lucide-trash2'), - ) as HTMLElement + const trashBtn = screen.getByRole('button', { name: 'Delete' }) await user.click(trashBtn) await user.click(await screen.findByRole('button', { name: 'Cancel' })) expect(deleteCalls).toBe(0) diff --git a/client/src/components/Journey/MobileEntryView.test.tsx b/client/src/components/Journey/MobileEntryView.test.tsx index 22f64c229..045fdbe1f 100644 --- a/client/src/components/Journey/MobileEntryView.test.tsx +++ b/client/src/components/Journey/MobileEntryView.test.tsx @@ -113,9 +113,9 @@ describe('MobileEntryView', () => { const order: string[] = [] const onClose = vi.fn(() => { order.push('close') }) const onDelete = vi.fn(() => { order.push('delete') }) - const { container } = renderView(buildEntry(), { onClose, onDelete }) + renderView(buildEntry(), { onClose, onDelete }) - fireEvent.click(container.querySelector('svg.lucide-trash2')!.closest('button')!) + fireEvent.click(screen.getByRole('button', { name: /Delete/ })) expect(order).toEqual(['close', 'delete']) }) @@ -123,7 +123,7 @@ describe('MobileEntryView', () => { it('FE-COMP-JENTRYVIEW-006: read-only journeys hide the edit and delete actions', () => { const { container } = renderView(buildEntry(), { readOnly: true }) expect(screen.queryByRole('button', { name: /Edit/ })).not.toBeInTheDocument() - expect(container.querySelector('svg.lucide-trash2')).toBeNull() + expect(screen.queryByRole('button', { name: /Delete/ })).not.toBeInTheDocument() // the close button stays expect(container.querySelector('svg.lucide-x')).not.toBeNull() }) diff --git a/client/src/components/Journey/MobileEntryView.tsx b/client/src/components/Journey/MobileEntryView.tsx index 92ab5a0b9..977f285b3 100644 --- a/client/src/components/Journey/MobileEntryView.tsx +++ b/client/src/components/Journey/MobileEntryView.tsx @@ -104,6 +104,7 @@ export default function MobileEntryView({ entry, readOnly, publicPhotoUrl, onClo