mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-14 13:27:09 +02:00
test(jellyfin): cover ping and quickConnectEnabled handlers
Both were added alongside the System/Info/Public handshake endpoint but had no direct test coverage.
This commit is contained in:
parent
b38750fd5b
commit
910c239e29
1 changed files with 22 additions and 0 deletions
|
|
@ -27,4 +27,26 @@ var _ = Describe("System", func() {
|
|||
Expect(info.Version).ToNot(BeEmpty())
|
||||
Expect(info.ProductName).To(Equal("Jellyfin Server"))
|
||||
})
|
||||
|
||||
It("responds to ping with the server name", func() {
|
||||
w := httptest.NewRecorder()
|
||||
r := httptest.NewRequest("GET", "/System/Ping", nil)
|
||||
api.ping(w, r)
|
||||
|
||||
Expect(w.Code).To(Equal(http.StatusOK))
|
||||
var name string
|
||||
Expect(json.Unmarshal(w.Body.Bytes(), &name)).To(Succeed())
|
||||
Expect(name).ToNot(BeEmpty())
|
||||
})
|
||||
|
||||
It("reports quick connect as disabled", func() {
|
||||
w := httptest.NewRecorder()
|
||||
r := httptest.NewRequest("GET", "/QuickConnect/Enabled", nil)
|
||||
api.quickConnectEnabled(w, r)
|
||||
|
||||
Expect(w.Code).To(Equal(http.StatusOK))
|
||||
var enabled bool
|
||||
Expect(json.Unmarshal(w.Body.Bytes(), &enabled)).To(Succeed())
|
||||
Expect(enabled).To(BeFalse())
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue