Support color customization from the admin (#2338)

* Add user-customizable theming. Closes #1915

* Prettified Code!

* Add user-customizable theming. Closes #1915

* Add explicit color for page content background

* Prettified Code!

Co-authored-by: gabek <gabek@users.noreply.github.com>
This commit is contained in:
Gabe Kangas
2022-11-12 20:26:55 -08:00
committed by GitHub
co-authored by gabek
parent 5bbf9db84a
commit 813f8692f0
33 changed files with 499 additions and 65 deletions
+34
View File
@@ -110,6 +110,40 @@ func TestCustomType(t *testing.T) {
}
}
func TestStringMap(t *testing.T) {
const testKey = "test string map key"
testMap := map[string]string{
"test string 1": "test string 2",
"test string 3": "test string 4",
}
// Save config entry to the database
if err := _datastore.Save(ConfigEntry{testKey, &testMap}); err != nil {
t.Error(err)
}
// Get the config entry from the database
entryResult, err := _datastore.Get(testKey)
if err != nil {
t.Error(err)
}
testResult, err := entryResult.getStringMap()
if err != nil {
t.Error(err)
}
fmt.Printf("%+v", testResult)
if testResult["test string 1"] != testMap["test string 1"] {
t.Error("expected", testMap["test string 1"], "but test returned", testResult["test string 1"])
}
if testResult["test string 3"] != testMap["test string 3"] {
t.Error("expected", testMap["test string 3"], "but test returned", testResult["test string 3"])
}
}
// Custom type for testing
type TestStruct struct {
Test string