@@ -10,9 +10,7 @@ import (
10
10
"github.com/stretchr/testify/assert"
11
11
"github.com/stretchr/testify/require"
12
12
13
- "github.com/coder/coder/v2/coderd/audit"
14
13
"github.com/coder/coder/v2/coderd/coderdtest"
15
- "github.com/coder/coder/v2/coderd/database"
16
14
"github.com/coder/coder/v2/coderd/rbac"
17
15
"github.com/coder/coder/v2/coderd/schedule/cron"
18
16
"github.com/coder/coder/v2/codersdk"
@@ -553,14 +551,12 @@ func TestEnterprisePostUser(t *testing.T) {
553
551
554
552
t .Run ("CreateWithoutOrg" , func (t * testing.T ) {
555
553
t .Parallel ()
556
- auditor := audit .NewMock ()
557
554
dv := coderdtest .DeploymentValues (t )
558
555
dv .Experiments = []string {string (codersdk .ExperimentMultiOrganization )}
559
556
560
557
client , firstUser := coderdenttest .New (t , & coderdenttest.Options {
561
558
Options : & coderdtest.Options {
562
559
DeploymentValues : dv ,
563
- Auditor : auditor ,
564
560
},
565
561
LicenseOptions : & coderdenttest.LicenseOptions {
566
562
Features : license.Features {
@@ -575,8 +571,6 @@ func TestEnterprisePostUser(t *testing.T) {
575
571
// Add an extra org to try and confuse user creation
576
572
coderdenttest .CreateOrganization (t , client , coderdenttest.CreateOrganizationOptions {})
577
573
578
- numLogs := len (auditor .AuditLogs ())
579
-
580
574
// nolint:gocritic // intentional using the owner.
581
575
// Manually making a user with the request instead of the coderdtest util
582
576
user , err := client .CreateUser (ctx , codersdk.CreateUserRequest {
@@ -585,11 +579,6 @@ func TestEnterprisePostUser(t *testing.T) {
585
579
Password : "SomeSecurePassword!" ,
586
580
})
587
581
require .NoError (t , err )
588
- numLogs ++ // add an audit log for user create
589
-
590
- require .Len (t , auditor .AuditLogs (), numLogs )
591
- require .Equal (t , database .AuditActionCreate , auditor .AuditLogs ()[numLogs - 1 ].Action )
592
- require .Equal (t , database .AuditActionLogin , auditor .AuditLogs ()[numLogs - 3 ].Action )
593
582
594
583
require .Len (t , user .OrganizationIDs , 1 )
595
584
assert .Equal (t , firstUser .OrganizationID , user .OrganizationIDs [0 ])
0 commit comments