0.3.03
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
@@ -75,6 +76,19 @@ func TestContinueWatchingIsServerControlledAndOnByDefault(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAppFontFamilyIsAValidatedGlobalConfiguration(t *testing.T) {
|
||||
definition, ok := configurationDefinitionFor("presentation.fontFamily")
|
||||
if !ok || definition.Type != "enum" || len(definition.Scopes) != 1 || definition.Scopes[0] != "global" {
|
||||
t.Fatalf("font family definition = %+v, found=%v", definition, ok)
|
||||
}
|
||||
if err := validateConfigurationValue(definition, json.RawMessage(`"inter"`)); err != nil {
|
||||
t.Fatalf("Inter was rejected: %v", err)
|
||||
}
|
||||
if err := validateConfigurationValue(definition, json.RawMessage(`"unknown"`)); err == nil {
|
||||
t.Fatal("unknown font family was accepted")
|
||||
}
|
||||
}
|
||||
|
||||
func TestClientCapabilitiesAreNormalizedAndBounded(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodGet, "/v1/status", nil)
|
||||
req.Header.Set("X-Memby-Capabilities", " Sonarr_Preroll_V1,server_features_v1,sonarr_preroll_v1,"+
|
||||
|
||||
Reference in New Issue
Block a user