aboutsummaryrefslogtreecommitdiff
path: root/internal/config/config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config_test.go')
-rw-r--r--internal/config/config_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index 94c33cd..9b72bc7 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -36,6 +36,31 @@ func TestLoadOverride(t *testing.T) {
}
}
+func TestWebDefaults(t *testing.T) {
+ def := Default()
+ if def.WebTheme != "transfiguration" {
+ t.Errorf("WebTheme default wrong: got %q, want %q", def.WebTheme, "transfiguration")
+ }
+ if def.WebPort != 0 {
+ t.Errorf("WebPort default wrong: got %d, want 0", def.WebPort)
+ }
+}
+
+func TestWebLoadsFromSeed(t *testing.T) {
+ dir := t.TempDir()
+ t.Setenv("XDG_CONFIG_HOME", dir)
+ cfg, err := Load()
+ if err != nil {
+ t.Fatal(err)
+ }
+ if cfg.WebTheme != "transfiguration" {
+ t.Errorf("WebTheme from seed wrong: got %q, want %q", cfg.WebTheme, "transfiguration")
+ }
+ if cfg.WebPort != 0 {
+ t.Errorf("WebPort from seed wrong: got %d, want 0", cfg.WebPort)
+ }
+}
+
func TestPartShown(t *testing.T) {
var empty Config
if !empty.PartShown("new", "psalm") {