File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -442,12 +442,13 @@ describe('Menu', () => {
442442 jest . runAllTimers ( ) ;
443443 } ) ;
444444
445- fireEvent . click ( container . querySelector ( '.rc-menu-item' ) ) ;
445+ const firstItem = container . querySelector ( '.rc-menu-item' ) as HTMLLIElement ;
446+ fireEvent . click ( firstItem ) ;
446447 const info = handleClick . mock . calls [ 0 ] [ 0 ] ;
447- const legacyItem = info . item as unknown as { props : { eventKey ?: string } } ;
448448 expect ( info . key ) . toBe ( '1' ) ;
449- expect ( legacyItem ) . toBeTruthy ( ) ;
450- expect ( legacyItem . props . eventKey ) . toBe ( '1' ) ;
449+ expect ( info . item ) . toBeTruthy ( ) ;
450+ expect ( info . item . props . eventKey ) . toBe ( '1' ) ;
451+ expect ( info . item . element ) . toBe ( firstItem ) ;
451452
452453 expect ( errorSpy ) . toHaveBeenCalledWith (
453454 'Warning: `info.item` is deprecated since we will move to function component that not provides React Node instance in future.' ,
You can’t perform that action at this time.
0 commit comments