9
9
"github.com/stretchr/testify/require"
10
10
11
11
"github.com/coder/coder/v2/cli/clitest"
12
+ "github.com/coder/coder/v2/coderd/coderdtest"
12
13
"github.com/coder/coder/v2/codersdk"
13
14
"github.com/coder/coder/v2/enterprise/coderd/coderdenttest"
14
15
"github.com/coder/coder/v2/pty/ptytest"
@@ -18,9 +19,10 @@ func TestFeaturesList(t *testing.T) {
18
19
t .Parallel ()
19
20
t .Run ("Table" , func (t * testing.T ) {
20
21
t .Parallel ()
21
- client , _ := coderdenttest .New (t , & coderdenttest.Options {DontAddLicense : true })
22
+ client , admin := coderdenttest .New (t , & coderdenttest.Options {DontAddLicense : true })
23
+ anotherClient , _ := coderdtest .CreateAnotherUser (t , client , admin .OrganizationID )
22
24
inv , conf := newCLI (t , "features" , "list" )
23
- clitest .SetupConfig (t , client , conf )
25
+ clitest .SetupConfig (t , anotherClient , conf )
24
26
pty := ptytest .New (t ).Attach (inv )
25
27
clitest .Start (t , inv )
26
28
pty .ExpectMatch ("user_limit" )
@@ -29,9 +31,10 @@ func TestFeaturesList(t *testing.T) {
29
31
t .Run ("JSON" , func (t * testing.T ) {
30
32
t .Parallel ()
31
33
32
- client , _ := coderdenttest .New (t , & coderdenttest.Options {DontAddLicense : true })
34
+ client , admin := coderdenttest .New (t , & coderdenttest.Options {DontAddLicense : true })
35
+ anotherClient , _ := coderdtest .CreateAnotherUser (t , client , admin .OrganizationID )
33
36
inv , conf := newCLI (t , "features" , "list" , "-o" , "json" )
34
- clitest .SetupConfig (t , client , conf )
37
+ clitest .SetupConfig (t , anotherClient , conf )
35
38
doneChan := make (chan struct {})
36
39
37
40
buf := bytes .NewBuffer (nil )
0 commit comments