mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 18:34:09 +00:00
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:
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user