It's state, not config.

This commit is contained in:
2026-07-10 05:21:03 +00:00
parent 4feaa63da0
commit 5c26c7530a
18 changed files with 184 additions and 216 deletions

View File

@@ -28,7 +28,7 @@ func TestGetGlobalConfig_ReturnsWrappedResponse(t *testing.T) {
},
}
data, _ := yaml.Marshal(cfg)
storage.WriteFile(filepath.Join(tmpDir, "config.yaml"), data, 0644)
storage.WriteFile(filepath.Join(tmpDir, "state.yaml"), data, 0644)
req := httptest.NewRequest("GET", "/api/v1/config", nil)
w := httptest.NewRecorder()
@@ -62,8 +62,8 @@ func TestGetGlobalConfig_ReturnsWrappedResponse(t *testing.T) {
func TestGetGlobalConfig_EmptyReturnsNotConfigured(t *testing.T) {
api, tmpDir := setupTestAPI(t)
// Remove the default config that EnsureGlobalConfig created
os.Remove(filepath.Join(tmpDir, "config.yaml"))
// Ensure no state file exists
os.Remove(filepath.Join(tmpDir, "state.yaml"))
req := httptest.NewRequest("GET", "/api/v1/config", nil)
w := httptest.NewRecorder()
@@ -168,7 +168,7 @@ func TestUpdateGlobalConfig(t *testing.T) {
}
// Verify file was written
data, _ := os.ReadFile(filepath.Join(tmpDir, "config.yaml"))
data, _ := os.ReadFile(filepath.Join(tmpDir, "state.yaml"))
var cfg map[string]any
yaml.Unmarshal(data, &cfg)