Allow managing members in the project resource (#480)

* Extend resource and datasource

* Adapt acc test to work without members

* Extend acc test and adjust resource

* Generate docs

* Fix lint

* Fix unit test

* Uniformize description with datasource and extend unit test

* Improve role field description

* Update TF state before adding/removing members

* Remove unused function

* Move intermediate map top state to mapProjectFields

* Improve code
This commit is contained in:
João Palet 2024-07-29 09:57:06 +01:00 committed by GitHub
parent af7d789945
commit 31ce9ab36d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 1195 additions and 169 deletions

View file

@ -225,3 +225,46 @@ func TestSupportedValuesDocumentation(t *testing.T) {
})
}
}
func TestIsLegacyProjectRole(t *testing.T) {
tests := []struct {
description string
role string
expected bool
}{
{
"non legacy role",
"owner",
false,
},
{
"leagcy role",
"project.owner",
true,
},
{
"leagcy role 2",
"project.admin",
true,
},
{
"leagcy role 3",
"project.member",
true,
},
{
"leagcy role 4",
"project.auditor",
true,
},
}
for _, tt := range tests {
t.Run(tt.description, func(t *testing.T) {
output := IsLegacyProjectRole(tt.role)
if output != tt.expected {
t.Fatalf("Data does not match: %v", output)
}
})
}
}