mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-29 19:17:49 +00:00
fa9f581d56
* chore: move to new org * logging * fix: org rename caos -> zitadel Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
61 lines
1.1 KiB
Go
61 lines
1.1 KiB
Go
package admin
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/zitadel/zitadel/internal/test"
|
|
"github.com/zitadel/zitadel/pkg/grpc/admin"
|
|
)
|
|
|
|
func TestAddIAMMemberToDomain(t *testing.T) {
|
|
type args struct {
|
|
req *admin.AddIAMMemberRequest
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
}{
|
|
{
|
|
name: "all fields filled",
|
|
args: args{
|
|
req: &admin.AddIAMMemberRequest{
|
|
UserId: "1232452",
|
|
Roles: []string{"admin"},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
got := AddIAMMemberToDomain(tt.args.req)
|
|
test.AssertFieldsMapped(t, got, "ObjectRoot")
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestUpdateIAMMemberToDomain(t *testing.T) {
|
|
type args struct {
|
|
req *admin.UpdateIAMMemberRequest
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
}{
|
|
{
|
|
name: "all fields filled",
|
|
args: args{
|
|
req: &admin.UpdateIAMMemberRequest{
|
|
UserId: "1232452",
|
|
Roles: []string{"admin"},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
got := UpdateIAMMemberToDomain(tt.args.req)
|
|
test.AssertFieldsMapped(t, got, "ObjectRoot")
|
|
})
|
|
}
|
|
}
|