mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-12 05:08:45 +01:00
test(jellyfin): cover empty Ids/EntryIds in playlist add/remove
This commit is contained in:
parent
34c1ebc4be
commit
15f5ba16e8
1 changed files with 20 additions and 0 deletions
|
|
@ -159,6 +159,16 @@ var _ = Describe("Playlists", func() {
|
|||
api.addToPlaylist(w, r)
|
||||
Expect(w.Code).To(Equal(http.StatusNotFound))
|
||||
})
|
||||
|
||||
It("passes no ids (not a spurious empty string) when the Ids param is absent", func() {
|
||||
w := httptest.NewRecorder()
|
||||
r := httptest.NewRequest("POST", "/Playlists/pl1/Items", nil).WithContext(context.Background())
|
||||
r = withChiURLParam(r, "playlistId", "pl1")
|
||||
api.addToPlaylist(w, r)
|
||||
Expect(w.Code).To(Equal(http.StatusNoContent))
|
||||
Expect(fp.addPlaylistID).To(Equal("pl1"))
|
||||
Expect(fp.addIds).To(BeEmpty())
|
||||
})
|
||||
})
|
||||
|
||||
Describe("removeFromPlaylist", func() {
|
||||
|
|
@ -180,5 +190,15 @@ var _ = Describe("Playlists", func() {
|
|||
api.removeFromPlaylist(w, r)
|
||||
Expect(w.Code).To(Equal(http.StatusNotFound))
|
||||
})
|
||||
|
||||
It("passes no ids (not a spurious empty string) when the EntryIds param is absent", func() {
|
||||
w := httptest.NewRecorder()
|
||||
r := httptest.NewRequest("DELETE", "/Playlists/pl1/Items", nil).WithContext(context.Background())
|
||||
r = withChiURLParam(r, "playlistId", "pl1")
|
||||
api.removeFromPlaylist(w, r)
|
||||
Expect(w.Code).To(Equal(http.StatusNoContent))
|
||||
Expect(fp.removePlaylistID).To(Equal("pl1"))
|
||||
Expect(fp.removeIds).To(BeEmpty())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue