@@ -605,6 +605,7 @@ func TestNotifyCreatedUser(t *testing.T) {
605
605
t .Run ("OwnerNotified" , func (t * testing.T ) {
606
606
t .Parallel ()
607
607
608
+ // given
608
609
notifyEnq := & testutil.FakeNotificationsEnqueuer {}
609
610
adminClient := coderdtest .New (t , & coderdtest.Options {
610
611
NotificationsEnqueuer : notifyEnq ,
@@ -614,6 +615,7 @@ func TestNotifyCreatedUser(t *testing.T) {
614
615
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitLong )
615
616
defer cancel ()
616
617
618
+ // when
617
619
user , err := adminClient .CreateUser (ctx , codersdk.CreateUserRequest {
618
620
OrganizationID : firstUser .OrganizationID ,
619
621
Email : "another@user.org" ,
@@ -622,6 +624,7 @@ func TestNotifyCreatedUser(t *testing.T) {
622
624
})
623
625
require .NoError (t , err )
624
626
627
+ // then
625
628
require .Len (t , notifyEnq .Sent , 1 )
626
629
require .Equal (t , notifications .TemplateUserAccountCreated , notifyEnq .Sent [0 ].TemplateID )
627
630
require .Equal (t , firstUser .UserID , notifyEnq .Sent [0 ].UserID )
@@ -632,6 +635,7 @@ func TestNotifyCreatedUser(t *testing.T) {
632
635
t .Run ("UserAdminNotified" , func (t * testing.T ) {
633
636
t .Parallel ()
634
637
638
+ // given
635
639
notifyEnq := & testutil.FakeNotificationsEnqueuer {}
636
640
adminClient := coderdtest .New (t , & coderdtest.Options {
637
641
NotificationsEnqueuer : notifyEnq ,
@@ -656,6 +660,7 @@ func TestNotifyCreatedUser(t *testing.T) {
656
660
})
657
661
require .NoError (t , err )
658
662
663
+ // when
659
664
member , err := adminClient .CreateUser (ctx , codersdk.CreateUserRequest {
660
665
OrganizationID : firstUser .OrganizationID ,
661
666
Email : "another@user.org" ,
@@ -664,6 +669,7 @@ func TestNotifyCreatedUser(t *testing.T) {
664
669
})
665
670
require .NoError (t , err )
666
671
672
+ // then
667
673
require .Len (t , notifyEnq .Sent , 3 )
668
674
669
675
// "User admin" account created, "owner" notified
0 commit comments