New config DefaultLanguage. Closes #1561

This commit is contained in:
Deluan 2022-09-27 19:16:10 -04:00
parent 72cde6dfde
commit cb3ba23fce
8 changed files with 75 additions and 24 deletions

View file

@ -159,6 +159,17 @@ var _ = Describe("serveIndex", func() {
Expect(config).To(HaveKeyWithValue("defaultTheme", "Light"))
})
It("sets the defaultLanguage", func() {
conf.Server.DefaultLanguage = "pt"
r := httptest.NewRequest("GET", "/index.html", nil)
w := httptest.NewRecorder()
serveIndex(ds, fs)(w, r)
config := extractAppConfig(w.Body.String())
Expect(config).To(HaveKeyWithValue("defaultLanguage", "pt"))
})
It("sets the enableCoverAnimation", func() {
conf.Server.EnableCoverAnimation = true
r := httptest.NewRequest("GET", "/index.html", nil)