mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-19 15:23:36 +00: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:
1 parent
b38750fd5b
commit
910c239e29
1 file changed
+22
@@ -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())
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user