@@ -330,5 +330,48 @@ define(function (require, exports, module) {
330330 banner . registerCustomFilter ( null ) ;
331331 banner . cleanNotificationBanner ( ) ;
332332 } ) ;
333+
334+ it ( "Should serialize multiple concurrent reRenderNotifications calls" , async function ( ) {
335+ banner . cleanNotificationBanner ( ) ;
336+
337+ const { notification} = getRandomNotification ( "all" , true ) ;
338+ let renderCount = 0 ;
339+
340+ // Set cache
341+ banner . _setBannerCache ( notification ) ;
342+
343+ // Register filter to track render calls
344+ banner . registerCustomFilter ( async ( ) => {
345+ renderCount ++ ;
346+ return true ;
347+ } ) ;
348+
349+ // Make 3 concurrent calls
350+ const promise1 = banner . reRenderNotifications ( ) ;
351+ const promise2 = banner . reRenderNotifications ( ) ;
352+ const promise3 = banner . reRenderNotifications ( ) ;
353+
354+ // First render: wait for banner, close it, wait for promise to resolve
355+ await _waitForBannerShown ( ) ;
356+ expect ( renderCount ) . toEqual ( 1 ) ;
357+ testWindow . $ ( '.close-icon' ) . click ( ) ;
358+ await promise1 ;
359+
360+ // Second render: wait for banner, close it, wait for promise to resolve
361+ await _waitForBannerShown ( ) ;
362+ expect ( renderCount ) . toEqual ( 2 ) ;
363+ testWindow . $ ( '.close-icon' ) . click ( ) ;
364+ await promise2 ;
365+
366+ // Third render: wait for banner, close it, wait for promise to resolve
367+ await _waitForBannerShown ( ) ;
368+ expect ( renderCount ) . toEqual ( 3 ) ;
369+ testWindow . $ ( '.close-icon' ) . click ( ) ;
370+ await promise3 ;
371+
372+ // Cleanup
373+ banner . registerCustomFilter ( null ) ;
374+ banner . cleanNotificationBanner ( ) ;
375+ } ) ;
333376 } ) ;
334377} ) ;
0 commit comments