(t *testing.T)
| 18 | ) |
| 19 | |
| 20 | func TestCreateGroup(t *testing.T) { |
| 21 | t.Parallel() |
| 22 | |
| 23 | t.Run("OK", func(t *testing.T) { |
| 24 | t.Parallel() |
| 25 | |
| 26 | client, admin := coderdenttest.New(t, &coderdenttest.Options{LicenseOptions: &coderdenttest.LicenseOptions{ |
| 27 | Features: license.Features{ |
| 28 | codersdk.FeatureTemplateRBAC: 1, |
| 29 | }, |
| 30 | }}) |
| 31 | anotherClient, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID, rbac.RoleUserAdmin()) |
| 32 | |
| 33 | var ( |
| 34 | groupName = "test" |
| 35 | avatarURL = "https://example.com" |
| 36 | ) |
| 37 | |
| 38 | inv, conf := newCLI(t, "groups", |
| 39 | "create", groupName, |
| 40 | "--avatar-url", avatarURL, |
| 41 | ) |
| 42 | |
| 43 | pty := ptytest.New(t) |
| 44 | inv.Stdout = pty.Output() |
| 45 | clitest.SetupConfig(t, anotherClient, conf) |
| 46 | |
| 47 | err := inv.Run() |
| 48 | require.NoError(t, err) |
| 49 | |
| 50 | pty.ExpectMatch(fmt.Sprintf("Successfully created group %s!", pretty.Sprint(cliui.DefaultStyles.Keyword, groupName))) |
| 51 | }) |
| 52 | } |
nothing calls this directly
no test coverage detected