#77: Make page title customizable

This commit is contained in:
TwinProduction
2021-09-11 01:51:14 -04:00
parent effad21c64
commit 7a68920889
12 changed files with 136 additions and 27 deletions

View File

@ -36,10 +36,15 @@ func TestLoadDefaultConfigurationFile(t *testing.T) {
func TestParseAndValidateConfigBytes(t *testing.T) {
file := t.TempDir() + "/test.db"
StaticFolder = "../web/static"
defer func() {
StaticFolder = "./web/static"
}()
config, err := parseAndValidateConfigBytes([]byte(fmt.Sprintf(`
storage:
file: %s
ui:
title: Test
services:
- name: twinnation
url: https://twinnation.org/health
@ -71,6 +76,9 @@ services:
if config == nil {
t.Fatal("Config shouldn't have been nil")
}
if config.UI == nil || config.UI.Title != "Test" {
t.Error("Expected Config.UI.Title to be Test")
}
if len(config.Services) != 3 {
t.Error("Should have returned two services")
}