MCPcopy Index your code
hub / github.com/coder/coder / TestDeleteMember

Function TestDeleteMember

coderd/members_test.go:53–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func TestDeleteMember(t *testing.T) {
54 t.Parallel()
55
56 t.Run("Allowed", func(t *testing.T) {
57 t.Parallel()
58 owner := coderdtest.New(t, nil)
59 first := coderdtest.CreateFirstUser(t, owner)
60 _, user := coderdtest.CreateAnotherUser(t, owner, first.OrganizationID)
61
62 ctx := testutil.Context(t, testutil.WaitMedium)
63 // Deleting members from the default org is not allowed.
64 // If this behavior changes, and we allow deleting members from the default org,
65 // this test should be updated to check there is no error.
66 // nolint:gocritic // must be an owner to see the user
67 err := owner.DeleteOrganizationMember(ctx, first.OrganizationID, user.Username)
68 require.NoError(t, err)
69 })
70}
71
72func TestListMembers(t *testing.T) {
73 t.Parallel()

Callers

nothing calls this directly

Calls 6

NewFunction · 0.92
CreateFirstUserFunction · 0.92
CreateAnotherUserFunction · 0.92
ContextFunction · 0.92
RunMethod · 0.65

Tested by

no test coverage detected