@@ -1490,61 +1490,6 @@ describe('storeNotificationBundle', () => {
14901490 ] ) ;
14911491 } ) ;
14921492
1493- it ( 'should truncate attachment title for SocialTwitter posts exceeding 140 characters' , ( ) => {
1494- const type = NotificationType . SourcePostAdded ;
1495- const longTitle = 'a' . repeat ( 200 ) ;
1496- const post = {
1497- ...postsFixture [ 0 ] ,
1498- title : longTitle ,
1499- type : PostType . SocialTwitter ,
1500- } as Reference < Post > ;
1501- const ctx : NotificationSourceContext & NotificationPostContext = {
1502- userIds : [ userId ] ,
1503- source : sourcesFixture [ 0 ] as Reference < Source > ,
1504- post,
1505- } ;
1506- const actual = generateNotificationV2 ( type , ctx ) ;
1507-
1508- expect ( actual . attachments ! [ 0 ] . title ) . toEqual ( `${ 'a' . repeat ( 137 ) } ...` ) ;
1509- expect ( actual . attachments ! [ 0 ] . title ! . length ) . toEqual ( 140 ) ;
1510- } ) ;
1511-
1512- it ( 'should not truncate attachment title for SocialTwitter posts within 140 characters' , ( ) => {
1513- const type = NotificationType . SourcePostAdded ;
1514- const shortTitle = 'a' . repeat ( 140 ) ;
1515- const post = {
1516- ...postsFixture [ 0 ] ,
1517- title : shortTitle ,
1518- type : PostType . SocialTwitter ,
1519- } as Reference < Post > ;
1520- const ctx : NotificationSourceContext & NotificationPostContext = {
1521- userIds : [ userId ] ,
1522- source : sourcesFixture [ 0 ] as Reference < Source > ,
1523- post,
1524- } ;
1525- const actual = generateNotificationV2 ( type , ctx ) ;
1526-
1527- expect ( actual . attachments ! [ 0 ] . title ) . toEqual ( shortTitle ) ;
1528- } ) ;
1529-
1530- it ( 'should not truncate attachment title for non-SocialTwitter posts' , ( ) => {
1531- const type = NotificationType . SourcePostAdded ;
1532- const longTitle = 'a' . repeat ( 200 ) ;
1533- const post = {
1534- ...postsFixture [ 0 ] ,
1535- title : longTitle ,
1536- type : PostType . Article ,
1537- } as Reference < Post > ;
1538- const ctx : NotificationSourceContext & NotificationPostContext = {
1539- userIds : [ userId ] ,
1540- source : sourcesFixture [ 0 ] as Reference < Source > ,
1541- post,
1542- } ;
1543- const actual = generateNotificationV2 ( type , ctx ) ;
1544-
1545- expect ( actual . attachments ! [ 0 ] . title ) . toEqual ( longTitle ) ;
1546- } ) ;
1547-
15481493 it ( 'should generate user_post_added notification' , ( ) => {
15491494 const type = NotificationType . UserPostAdded ;
15501495 const ctx : NotificationUserContext & NotificationPostContext = {
0 commit comments