1
0

fix: hide navidrome link when webUrl is null (cleared subsonic url)

This commit is contained in:
2026-09-04 14:04:24 +02:00
parent 642ca52c71
commit d3c8754a5d
3 changed files with 13 additions and 2 deletions

View File

@@ -200,6 +200,17 @@ describe('ItemPage', () => {
expect(screen.queryByRole('link', { name: /listen in navidrome/i })).toBeNull()
})
it('link hidden when the subsonic url was cleared (webUrl null)', async () => {
vi.mocked(api.getItem).mockResolvedValue({
...item,
ripStatus: 'ripped',
matchedAlbum: { id: 77, subsonicId: 'alb-1', lastPlayedAt: null, webUrl: null },
} as never)
renderItem()
await waitFor(() => expect(screen.getByRole('heading', { name: 'Motion' })).toBeTruthy())
expect(screen.queryByRole('link', { name: /listen in navidrome/i })).toBeNull()
})
it('shows last played under the rip banner', async () => {
vi.mocked(api.getItem).mockResolvedValue(rippedItem as never)
renderItem()