TestRepositoryList tests listing all environments
(t *testing.T)
| 56 | |
| 57 | // TestRepositoryList tests listing all environments |
| 58 | func TestRepositoryList(t *testing.T) { |
| 59 | t.Parallel() |
| 60 | WithRepository(t, "repository-list", SetupEmptyRepo, func(t *testing.T, repo *repository.Repository, user *UserActions) { |
| 61 | ctx := context.Background() |
| 62 | |
| 63 | // Create two environments |
| 64 | env1 := user.CreateEnvironment("Environment 1", "First test environment") |
| 65 | env2 := user.CreateEnvironment("Environment 2", "Second test environment") |
| 66 | |
| 67 | // List should return at least 2 |
| 68 | envs, err := repo.List(ctx) |
| 69 | require.NoError(t, err) |
| 70 | assert.GreaterOrEqual(t, len(envs), 2) |
| 71 | |
| 72 | // Verify the environments are in the list |
| 73 | var foundIDs []string |
| 74 | for _, e := range envs { |
| 75 | foundIDs = append(foundIDs, e.ID) |
| 76 | } |
| 77 | assert.Contains(t, foundIDs, env1.ID) |
| 78 | assert.Contains(t, foundIDs, env2.ID) |
| 79 | }) |
| 80 | } |
| 81 | |
| 82 | // TestRepositoryDelete tests deleting an environment |
| 83 | func TestRepositoryDelete(t *testing.T) { |
nothing calls this directly
no test coverage detected