@@ -504,7 +504,7 @@ describe('TokenList', () => {
504504 DeviceEventEmitter . removeAllListeners ( 'scrollToTokenIndex' ) ;
505505 } ) ;
506506
507- it ( 'scrolls to token using FlashList scrollToIndex when token is found and using FlashList mode' , async ( ) => {
507+ it ( 'scrolls to token using FlashList scrollToIndex when token is found and using FlashList mode' , ( ) => {
508508 // Set up for FlashList mode (homepage redesign disabled)
509509 mockUseSelector . mockImplementation ( ( selector ) => {
510510 if ( selector . toString ( ) . includes ( 'selectHomepageRedesignV1Enabled' ) ) {
@@ -515,30 +515,22 @@ describe('TokenList', () => {
515515
516516 renderComponent ( { isFullView : true } ) ;
517517
518- // Emit scroll-to-token event (handler schedules requestAnimationFrame)
518+ // Emit scroll-to-token event
519519 act ( ( ) => {
520520 DeviceEventEmitter . emit ( SCROLL_TO_TOKEN_EVENT , {
521521 address : '0x123' ,
522522 chainId : '0x1' ,
523523 } ) ;
524524 } ) ;
525525
526- // Flush requestAnimationFrame so scrollToIndex is invoked
527- await act (
528- async ( ) =>
529- new Promise < void > ( ( resolve ) =>
530- requestAnimationFrame ( ( ) => resolve ( ) ) ,
531- ) ,
532- ) ;
533-
534526 expect ( mockScrollToIndex ) . toHaveBeenCalledWith ( {
535527 index : 0 ,
536528 animated : true ,
537529 viewPosition : 0.5 ,
538530 } ) ;
539531 } ) ;
540532
541- it ( 'scrolls to correct index when token is not first in list' , async ( ) => {
533+ it ( 'scrolls to correct index when token is not first in list' , ( ) => {
542534 mockUseSelector . mockImplementation ( ( selector ) => {
543535 if ( selector . toString ( ) . includes ( 'selectHomepageRedesignV1Enabled' ) ) {
544536 return false ;
@@ -555,13 +547,6 @@ describe('TokenList', () => {
555547 } ) ;
556548 } ) ;
557549
558- await act (
559- async ( ) =>
560- new Promise < void > ( ( resolve ) =>
561- requestAnimationFrame ( ( ) => resolve ( ) ) ,
562- ) ,
563- ) ;
564-
565550 expect ( mockScrollToIndex ) . toHaveBeenCalledWith ( {
566551 index : 1 ,
567552 animated : true ,
@@ -668,7 +653,7 @@ describe('TokenList', () => {
668653 } ) ;
669654 } ) ;
670655
671- it ( 'matches token address case-insensitively' , async ( ) => {
656+ it ( 'matches token address case-insensitively' , ( ) => {
672657 mockUseSelector . mockImplementation ( ( selector ) => {
673658 if ( selector . toString ( ) . includes ( 'selectHomepageRedesignV1Enabled' ) ) {
674659 return false ;
@@ -685,13 +670,6 @@ describe('TokenList', () => {
685670 } ) ;
686671 } ) ;
687672
688- await act (
689- async ( ) =>
690- new Promise < void > ( ( resolve ) =>
691- requestAnimationFrame ( ( ) => resolve ( ) ) ,
692- ) ,
693- ) ;
694-
695673 expect ( mockScrollToIndex ) . toHaveBeenCalledWith ( {
696674 index : 0 ,
697675 animated : true ,
0 commit comments