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
@@ -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(<><ToastContainer /><BackupPanel /></>)
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)