Skip to content

Commit 595d85c

Browse files
committed
fix tests
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
1 parent 35bc7ba commit 595d85c

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

app/controlplane/pkg/biz/group_integration_test.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,6 @@ func (s *groupMembersIntegrationTestSuite) TestAddMemberToGroup() {
912912
},
913913
UserEmail: "add-user2@example.com",
914914
RequesterID: uuid.MustParse(s.user.ID),
915-
Maintainer: true,
916915
}
917916

918917
_, err := s.Group.AddMemberToGroup(ctx, uuid.MustParse(s.org.ID), opts)
@@ -928,6 +927,22 @@ func (s *groupMembersIntegrationTestSuite) TestAddMemberToGroup() {
928927
s.NoError(err)
929928
s.Equal(3, count) // still the original 3 members
930929
})
930+
931+
s.Run("a viewer cannot be maintainer", func() {
932+
// Try to add user2 again (who we added in the first test)
933+
opts := &biz.AddMemberToGroupOpts{
934+
IdentityReference: &biz.IdentityReference{
935+
ID: &s.group.ID,
936+
},
937+
UserEmail: "add-user2@example.com",
938+
RequesterID: uuid.MustParse(s.user.ID),
939+
Maintainer: true,
940+
}
941+
942+
_, err := s.Group.AddMemberToGroup(ctx, uuid.MustParse(s.org.ID), opts)
943+
s.Error(err)
944+
s.True(biz.IsErrValidation(err))
945+
})
931946
}
932947

933948
// Test removing members from groups

0 commit comments

Comments
 (0)