Get lossless format list from server
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/navidrome/navidrome/conf"
|
||||
"github.com/navidrome/navidrome/consts"
|
||||
@@ -155,6 +156,17 @@ var _ = Describe("serveIndex", func() {
|
||||
config := extractAppConfig(w.Body.String())
|
||||
Expect(config).To(HaveKeyWithValue("version", consts.Version()))
|
||||
})
|
||||
|
||||
It("sets the losslessFormats", func() {
|
||||
r := httptest.NewRequest("GET", "/index.html", nil)
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
serveIndex(ds, fs)(w, r)
|
||||
|
||||
config := extractAppConfig(w.Body.String())
|
||||
expected := strings.ToUpper(strings.Join(consts.LosslessFormats, ","))
|
||||
Expect(config).To(HaveKeyWithValue("losslessFormats", expected))
|
||||
})
|
||||
})
|
||||
|
||||
var appConfigRegex = regexp.MustCompile(`(?m)window.__APP_CONFIG__="([^"]*)`)
|
||||
|
||||
Reference in New Issue
Block a user