File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ class Navbar extends React.Component {
67
67
onBlur = { this . hideMenu }
68
68
onMouseEnter = { this . blockBlur }
69
69
onMouseLeave = { this . blockBlur }
70
+ aria-label = "navbar-mobile"
70
71
>
71
72
< div className = { navLinks } >
72
73
{ children && typeof children === 'object' && children . map ? children . map ( child => < div onClick = { this . toggleMenu } > { child } </ div > ) : children }
Original file line number Diff line number Diff line change @@ -41,4 +41,12 @@ describe('Navbar Edge case tests', () => {
41
41
wrappedComponent . find ( FaBars ) . simulate ( 'blur' ) ;
42
42
expect ( simulatedValue ( ) ) . equals ( false ) ;
43
43
} ) ;
44
+
45
+ it ( 'Shoud toggle blockOnBlur state on mouseneter and mountleave events' , ( ) => {
46
+ const actualValue = ( ) => wrappedComponent . state ( ) . blockBlur ;
47
+ wrappedComponent . find ( 'div[aria-label="navbar-mobile"]' ) . simulate ( 'mouseenter' ) ;
48
+ expect ( actualValue ( ) ) . to . equal ( true ) ;
49
+ wrappedComponent . find ( 'div[aria-label="navbar-mobile"]' ) . simulate ( 'mouseleave' ) ;
50
+ expect ( actualValue ( ) ) . to . equal ( false ) ;
51
+ } ) ;
44
52
} ) ;
You can’t perform that action at this time.
0 commit comments