feat: navidrome deep link replaces in-app player
This commit is contained in:
@@ -10,15 +10,6 @@ function jsonOk(body: unknown) {
|
||||
}
|
||||
|
||||
describe('api additions', () => {
|
||||
it('album tracks + played + stream url', async () => {
|
||||
fetchMock.mockImplementation(() => jsonOk({ id: 'a1', title: 'Motion', artist: 'TCO', tracks: [] }))
|
||||
await api.getAlbumTracks('a1')
|
||||
expect(fetchMock).toHaveBeenCalledWith('/api/album/a1/tracks', expect.anything())
|
||||
await api.markPlayed('a1')
|
||||
expect(fetchMock).toHaveBeenCalledWith('/api/album/a1/played', expect.objectContaining({ method: 'POST' }))
|
||||
expect(api.streamUrl('s 1')).toBe('/api/stream/s%201')
|
||||
})
|
||||
|
||||
it('stats, loans, backups urls', async () => {
|
||||
fetchMock.mockImplementation(() => jsonOk({}))
|
||||
await api.getStats()
|
||||
@@ -36,7 +27,7 @@ describe('api additions', () => {
|
||||
fetchMock.mockReturnValue(
|
||||
Promise.resolve(new Response(JSON.stringify({ error: 'no_subsonic_config' }), { status: 409 }))
|
||||
)
|
||||
const err = await api.getAlbumTracks('a1').catch((e) => e)
|
||||
const err = await api.startSync().catch((e) => e)
|
||||
expect(err).toBeInstanceOf(ApiError)
|
||||
expect((err as ApiError).code).toBe('no_subsonic_config')
|
||||
})
|
||||
@@ -45,7 +36,6 @@ describe('api additions', () => {
|
||||
fetchMock.mockClear()
|
||||
fetchMock.mockImplementation(() => jsonOk({ ok: true }))
|
||||
await api.returnLoan(7)
|
||||
await api.markPlayed('a1')
|
||||
await api.logout()
|
||||
await api.triggerBackup()
|
||||
for (const call of fetchMock.mock.calls) {
|
||||
|
||||
Reference in New Issue
Block a user