@@ -19,6 +19,8 @@ import { UserClass } from '../../support/user/UserClass';
1919import { REACTION_EMOJIS , reactOnFeed } from '../../utils/activityFeed' ;
2020import { performAdminLogin } from '../../utils/admin' ;
2121import {
22+ getAuthContext ,
23+ getToken ,
2224 redirectToHomePage ,
2325 removeLandingBanner ,
2426 uuid ,
@@ -411,7 +413,6 @@ test.describe('Mention notifications in Notification Box', () => {
411413
412414 await apiContext . post ( '/api/v1/feed' , {
413415 data : {
414- from : adminUser . responseData . name ,
415416 message : 'Initial conversation thread for mention test' ,
416417 about : `<#E::table::${ entity . entityResponseData . fullyQualifiedName } >` ,
417418 type : 'Conversation' ,
@@ -430,6 +431,30 @@ test.describe('Mention notifications in Notification Box', () => {
430431 await test . step ( 'User1 mentions admin user in a reply' , async ( ) => {
431432 await entity . visitEntityPage ( user1Page ) ;
432433
434+ const token = await getToken ( user1Page ) ;
435+ const apiContext = await getAuthContext ( token ) ;
436+ const feedUrl = `/api/v1/feed?entityLink=${ encodeURIComponent (
437+ `<#E::table::${ entity . entityResponseData . fullyQualifiedName } >`
438+ ) } &type=Conversation&limit=25`;
439+
440+ await expect
441+ . poll (
442+ async ( ) => {
443+ const response = await apiContext . get ( feedUrl ) ;
444+ const data = await response . json ( ) ;
445+
446+ return ( data . data ?? [ ] ) . some ( ( thread : { message ?: string } ) =>
447+ thread . message ?. includes (
448+ 'Initial conversation thread for mention test'
449+ )
450+ ) ;
451+ } ,
452+ { timeout : 60_000 , intervals : [ 2_000 ] }
453+ )
454+ . toBe ( true ) ;
455+
456+ await apiContext . dispose ( ) ;
457+
433458 await user1Page . getByTestId ( 'activity_feed' ) . click ( ) ;
434459
435460 await waitForAllLoadersToDisappear ( user1Page ) ;
0 commit comments