mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-22 07:53:38 +01:00
22 lines
552 B
Go
22 lines
552 B
Go
|
package config
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestUIConfig_validateAndSetDefaults(t *testing.T) {
|
||
|
StaticFolder = "../web/static"
|
||
|
defer func() {
|
||
|
StaticFolder = "./web/static"
|
||
|
}()
|
||
|
uiConfig := &UIConfig{Title: ""}
|
||
|
if err := uiConfig.validateAndSetDefaults(); err != nil {
|
||
|
t.Error("expected no error, got", err.Error())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestGetDefaultUIConfig(t *testing.T) {
|
||
|
defaultUIConfig := GetDefaultUIConfig()
|
||
|
if defaultUIConfig.Title != defaultTitle {
|
||
|
t.Error("expected GetDefaultUIConfig() to return defaultTitle, got", defaultUIConfig.Title)
|
||
|
}
|
||
|
}
|