Complete the ConfigKit resource migration

This commit is contained in:
2026-11-02 13:00:27 +00:00
parent b0bfe857fe
commit fc568aa0b2
3 changed files with 32 additions and 6 deletions

View File

@@ -360,6 +360,22 @@ func TestLoadRejectsMalformedHeadersAndLegacyResourceMappings(t *testing.T) {
}
}
func TestNestedConfigRemainsApplicationData(t *testing.T) {
state, err := load(mapping("nested config", map[string]any{
"config": map[string]any{},
"profiles": []any{map[string]any{"id": "example", "extra_params": map[string]any{
"config": map[string]any{"imports": "provider data"},
}}},
}), nil)
if err != nil {
t.Fatal(err)
}
profile, err := state.GetProfile(context.Background(), "example")
if err != nil || profile.ResolvedTarget.ExtraParams["config"].(map[string]any)["imports"] != "provider data" {
t.Fatalf("nested application data = %+v, %v", profile, err)
}
}
func TestLoadConsumesAcceptedUnderlayVersionAndValidatesHeaderlessPayload(t *testing.T) {
underlay := mapping("declared underlay", map[string]any{
"version": int64(2),