File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -4611,8 +4611,27 @@ func (s *MethodTestSuite) TestNotifications() {
4611
4611
}))
4612
4612
4613
4613
s .Run ("InsertInboxNotification" , s .Subtest (func (_ database.Store , check * expects ) {
4614
- owner := uuid.UUID {}
4615
- check .Args (database.InsertInboxNotificationParams {}).Asserts (rbac .ResourceInboxNotification .WithOwner (owner .String ()), policy .ActionCreate )
4614
+ u := dbgen .User (s .T (), db , database.User {})
4615
+ o := dbgen .Organization (s .T (), db , database.Organization {})
4616
+ tpl := dbgen .Template (s .T (), db , database.Template {
4617
+ OrganizationID : o .ID ,
4618
+ CreatedBy : u .ID ,
4619
+ })
4620
+
4621
+ notifID := uuid .New ()
4622
+
4623
+ targets := []uuid.UUID {u .ID , tpl .ID }
4624
+
4625
+ check .Args (database.InsertInboxNotificationParams {
4626
+ ID : notifID ,
4627
+ UserID : u .ID ,
4628
+ TemplateID : tpl .ID ,
4629
+ Targets : targets ,
4630
+ Title : "test title" ,
4631
+ Content : "test content notification" ,
4632
+ Icon : "test icon" ,
4633
+ Actions : json .RawMessage ("{}" ),
4634
+ }).Asserts (rbac .ResourceInboxNotification .WithOwner (o .ID .String ()), policy .ActionCreate )
4616
4635
}))
4617
4636
4618
4637
s .Run ("SetInboxNotificationAsRead" , s .Subtest (func (db database.Store , check * expects ) {
You can’t perform that action at this time.
0 commit comments