fix(deps): keep Lucide SVG markup and Undici tests compatible

Build standalone SVG icons without a React context. Use accessible actions in tests and give the mocked dispatchers the interface the adapter expects.
This commit is contained in:
Maurice
2026-12-01 13:44:02 +01:00
parent 7f4ece2e6f
commit b77c246df4
15 changed files with 107 additions and 40 deletions
@@ -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()
})
@@ -104,6 +104,7 @@ export default function MobileEntryView({ entry, readOnly, publicPhotoUrl, onClo
</button>
<button type="button"
onClick={() => { onClose(); onDelete(); }}
aria-label={t('common.delete')}
className="w-8 h-8 rounded-lg flex items-center justify-center text-zinc-400 hover:bg-red-50 hover:text-red-500 dark:hover:bg-red-900/20 dark:hover:text-red-400 transition-colors"
>
<Trash2 size={15} />