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:
parent
af7d789945
commit
31ce9ab36d
16 changed files with 1195 additions and 169 deletions
|
|
@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue