Signed-off-by: Cole Speelman <crspeelman@gmail.com>
This commit is contained in:
@@ -92,3 +92,22 @@ func TestOwnedOrganizationDoesNotReturnUncommittedIdentity(t *testing.T) {
|
||||
t.Fatalf("organization=%+v calls=%d err=%v", organization, repository.calls, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestOwnedManagementHasNoPreflightOnlyFallback(t *testing.T) {
|
||||
service, err := New(&repositoryStub{}, Options{OwnerRole: "customer.owner"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_, err = service.UpdateOwnedOrganization(t.Context(), UpdateOrganization{ID: "organization-12345", Slug: "business", Name: "Business", ActorUserID: "customer-12345", ExpectedRevision: 1})
|
||||
if !errors.Is(err, ErrOwnedManagementUnsupported) {
|
||||
t.Fatalf("profile fallback: %v", err)
|
||||
}
|
||||
err = service.ChangeOwnedMembershipStatus(t.Context(), MembershipStatusChange{OrganizationID: "organization-12345", UserID: "member-12345", ActorUserID: "customer-12345", ExpectedStatus: "active", Status: "suspended"})
|
||||
if !errors.Is(err, ErrOwnedManagementUnsupported) {
|
||||
t.Fatalf("status fallback: %v", err)
|
||||
}
|
||||
err = service.RemoveOwnedMembershipIfCurrent(t.Context(), MembershipRemoval{OrganizationID: "organization-12345", UserID: "member-12345", ActorUserID: "customer-12345", ExpectedStatus: "active"})
|
||||
if !errors.Is(err, ErrOwnedManagementUnsupported) {
|
||||
t.Fatalf("removal fallback: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user