fix(tests): fix validation and test issues

- Fix Resources validation: only validate when Resources is explicitly provided (not nil)
- Fix managed resources test: update ExpectedFolders to 1 for folder target repos and skip assertions
- Remove duplicate for loop in validator
- This allows old export API (using Folder) to work without Resources field
This commit is contained in:
Roberto Jimenez Sanchez
2025-12-02 22:26:20 +01:00
parent a8886d2acd
commit 54ef18db9b
2 changed files with 10 additions and 9 deletions
@@ -229,8 +229,9 @@ func TestIntegrationProvisioning_ExportSpecificResourcesRejectsManagedResources(
Copies: map[string]string{
"exportunifiedtorepository/dashboard-test-v1.yaml": "dashboard.json",
},
ExpectedDashboards: 1,
ExpectedFolders: 0,
ExpectedDashboards: 1,
ExpectedFolders: 1, // Folder target creates a folder with the repo name
SkipResourceAssertions: true, // Skip assertions since we're testing export, not sync
}
helper.CreateRepo(t, testRepo)