@@ -693,7 +693,12 @@ it('should not send email notification if the user prefers not to receive them',
693693 const userId = '1' ;
694694 const repo = con . getRepository ( User ) ;
695695 const user = await repo . findOneBy ( { id : userId } ) ;
696- await repo . save ( { ...user , notificationEmail : false } ) ;
696+ await repo . save ( {
697+ ...user ,
698+ notificationFlags : {
699+ [ NotificationType . CommentUpvoteMilestone ] : { email : 'muted' } ,
700+ } ,
701+ } ) ;
697702 const post = await con . getRepository ( ArticlePost ) . save ( postsFixture [ 0 ] ) ;
698703 const comment = await con . getRepository ( Comment ) . save ( {
699704 id : 'c1' ,
@@ -729,7 +734,12 @@ it('should not send follow email notification if the user prefers not to receive
729734 const userId = '1' ;
730735 const repo = con . getRepository ( User ) ;
731736 const user = await repo . findOneBy ( { id : userId } ) ;
732- await repo . save ( { ...user , followingEmail : false } ) ;
737+ await repo . save ( {
738+ ...user ,
739+ notificationFlags : {
740+ [ NotificationType . UserPostAdded ] : { email : 'muted' } ,
741+ } ,
742+ } ) ;
733743 const post = await con . getRepository ( ArticlePost ) . save ( postsFixture [ 0 ] ) ;
734744 const ctx : NotificationUserContext & NotificationPostContext = {
735745 userIds : [ '1' ] ,
@@ -757,7 +767,12 @@ it('should not send award email notification if the user prefers not to receive
757767 const repo = con . getRepository ( User ) ;
758768 const receiver = await repo . findOneBy ( { id : userId } ) ;
759769 const sender = await repo . findOneBy ( { id : '2' } ) ;
760- await repo . save ( { ...receiver , awardEmail : false } ) ;
770+ await repo . save ( {
771+ ...receiver ,
772+ notificationFlags : {
773+ [ NotificationType . UserReceivedAward ] : { email : 'muted' } ,
774+ } ,
775+ } ) ;
761776
762777 await saveFixtures ( con , Product , [
763778 {
0 commit comments