chore: seed migration objects batch 5
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
)
|
||||
|
||||
func TestImUserGovernanceAllowsAdminActor(t *testing.T) {
|
||||
in := &ImUserGovernanceInp{TenantId: 1, UserId: 2}
|
||||
if err := in.Filter(gctx.New()); err != nil {
|
||||
t.Fatalf("admin governance should not require an IM actor: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImUserActionInputs(t *testing.T) {
|
||||
ctx := gctx.New()
|
||||
if err := (&ImUserAdjustGroupInp{UserId: 2, GroupId: 3}).Filter(ctx); err != nil {
|
||||
t.Fatalf("valid group adjustment rejected: %v", err)
|
||||
}
|
||||
if err := (&ImUserAdjustGroupInp{UserId: 2}).Filter(ctx); err == nil {
|
||||
t.Fatal("missing group must be rejected")
|
||||
}
|
||||
if err := (&ImUserIPWhitelistInp{UserId: 2}).Filter(ctx); err != nil {
|
||||
t.Fatalf("valid whitelist input rejected: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user