test(transit): find mode icons on the line badge

The search test must look for the icon beside the label inside the shared badge.
This commit is contained in:
Maurice
2026-12-01 11:28:14 +01:00
parent 8f20f9f7ea
commit 7fc011408a
@@ -616,7 +616,7 @@ describe('TransitSearchPanel', () => {
await pickFromAndTo(user)
await user.click(screen.getByRole('button', { name: /^Search$/ }))
await screen.findByText('B1')
const icon = (text: string) => screen.getAllByText(text)[0].closest('span')?.querySelector('svg')?.getAttribute('class')
const icon = (text: string) => screen.getAllByText(text)[0].parentElement?.querySelector('svg')?.getAttribute('class')
expect(icon('B1')).toContain('lucide-bus')
expect(icon('M4')).toContain('lucide-tram-front')
expect(icon('F10')).toContain('lucide-sailboat')