mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-26 01:43:41 +01:00
27 lines
661 B
Go
27 lines
661 B
Go
|
package ui
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestConfig_ValidateAndSetDefaults(t *testing.T) {
|
||
|
StaticFolder = "../../web/static"
|
||
|
defer func() {
|
||
|
StaticFolder = "./web/static"
|
||
|
}()
|
||
|
cfg := &Config{Title: ""}
|
||
|
if err := cfg.ValidateAndSetDefaults(); err != nil {
|
||
|
t.Error("expected no error, got", err.Error())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestGetDefaultConfig(t *testing.T) {
|
||
|
defaultConfig := GetDefaultConfig()
|
||
|
if defaultConfig.Title != defaultTitle {
|
||
|
t.Error("expected GetDefaultConfig() to return defaultTitle, got", defaultConfig.Title)
|
||
|
}
|
||
|
if defaultConfig.Logo != defaultLogo {
|
||
|
t.Error("expected GetDefaultConfig() to return defaultLogo, got", defaultConfig.Logo)
|
||
|
}
|
||
|
}
|