@@ -204,23 +204,23 @@ describe('Menu', () => {
204
204
function hover ( from : Point , to : Point , inMenu : HTMLElement , duration : number ) {
205
205
const getNextPoint = getNextPointIterator ( from , to ) ;
206
206
207
- let currPoint : Point | null = from ;
208
- let currElement = getElementAt ( currPoint ) ;
207
+ let currentPoint : Point | null = from ;
208
+ let currElement = getElementAt ( currentPoint ) ;
209
209
210
210
const timeout = duration / ( to . x - from . x ) ;
211
211
212
212
let numEnters = 0 ;
213
- while ( currPoint ) {
214
- mousemove ( inMenu , currPoint ) ;
215
- const nextElement = getElementAt ( currPoint ) ;
213
+ while ( currentPoint ) {
214
+ mousemove ( inMenu , currentPoint ) ;
215
+ const nextElement = getElementAt ( currentPoint ) ;
216
216
if ( nextElement !== currElement && nextElement instanceof HTMLButtonElement ) {
217
217
numEnters ++ ;
218
218
mouseout ( currElement ) ;
219
- mouseenter ( nextElement , currPoint ) ;
219
+ mouseenter ( nextElement , currentPoint ) ;
220
220
currElement = nextElement ;
221
221
fixture . detectChanges ( ) ;
222
222
}
223
- currPoint = getNextPoint ( ) ;
223
+ currentPoint = getNextPoint ( ) ;
224
224
tick ( timeout ) ;
225
225
}
226
226
return numEnters ;
@@ -243,27 +243,23 @@ describe('Menu', () => {
243
243
} ;
244
244
}
245
245
246
- it (
247
- 'should close the edit menu when hovering directly down from the edit menu trigger to' +
248
- ' the print item without waiting' ,
249
- fakeAsync ( ( ) => {
250
- openFileMenu ( ) ;
251
- openMenuOnHover ( nativeEditTrigger ! ) ;
252
- const editPosition = nativeEditTrigger ! . getBoundingClientRect ( ) ;
253
- const printPosition = nativeFileButtons ! [ 4 ] . getBoundingClientRect ( ) ;
254
-
255
- const numEnterEvents = hover (
256
- editPosition ,
257
- { x : printPosition . x + 5 , y : printPosition . y + 1 } ,
258
- nativeMenus [ 0 ] ,
259
- 100 ,
260
- ) ;
261
- detectChanges ( ) ;
246
+ it ( 'should close the edit menu when hovering directly down from the edit menu trigger to the print item without waiting' , fakeAsync ( ( ) => {
247
+ openFileMenu ( ) ;
248
+ openMenuOnHover ( nativeEditTrigger ! ) ;
249
+ const editPosition = nativeEditTrigger ! . getBoundingClientRect ( ) ;
250
+ const printPosition = nativeFileButtons ! [ 4 ] . getBoundingClientRect ( ) ;
251
+
252
+ const numEnterEvents = hover (
253
+ { x : editPosition . x , y : editPosition . y + 1 } ,
254
+ { x : printPosition . x + 5 , y : printPosition . y + 1 } ,
255
+ nativeMenus [ 0 ] ,
256
+ 100 ,
257
+ ) ;
258
+ detectChanges ( ) ;
262
259
263
- expect ( numEnterEvents ) . toBe ( 4 ) ;
264
- expect ( nativeMenus . length ) . toBe ( 1 ) ;
265
- } ) ,
266
- ) ;
260
+ expect ( numEnterEvents ) . toBe ( 4 ) ;
261
+ expect ( nativeMenus . length ) . toBe ( 1 ) ;
262
+ } ) ) ;
267
263
268
264
it ( 'should close the edit menu after moving towards submenu and stopping' , fakeAsync ( ( ) => {
269
265
openFileMenu ( ) ;
@@ -448,29 +444,25 @@ describe('Menu', () => {
448
444
} ;
449
445
}
450
446
451
- it (
452
- 'should close the edit menu when hovering directly up from the edit menu trigger to' +
453
- ' the print item without waiting' ,
454
- fakeAsync ( ( ) => {
455
- openFileMenu ( ) ;
456
- openMenuOnHover ( nativeEditTrigger ! ) ;
457
-
458
- const editPosition = nativeEditTrigger ! . getBoundingClientRect ( ) ;
459
- const printPosition = nativeFileButtons ! [ 0 ] . getBoundingClientRect ( ) ;
460
-
461
- const numEnterEvents = hover (
462
- { x : editPosition . x + editPosition . width / 2 , y : editPosition . y + 5 } ,
463
- { x : printPosition . x + 10 , y : printPosition . y - 10 } ,
464
- nativeMenus [ 0 ] ,
465
- 100 ,
466
- ) ;
467
- detectChanges ( ) ;
468
- flush ( ) ;
447
+ it ( 'should close the edit menu when hovering directly up from the edit menu trigger to the print item without waiting' , fakeAsync ( ( ) => {
448
+ openFileMenu ( ) ;
449
+ openMenuOnHover ( nativeEditTrigger ! ) ;
450
+
451
+ const editPosition = nativeEditTrigger ! . getBoundingClientRect ( ) ;
452
+ const printPosition = nativeFileButtons ! [ 0 ] . getBoundingClientRect ( ) ;
453
+
454
+ const numEnterEvents = hover (
455
+ { x : editPosition . x + editPosition . width / 2 , y : editPosition . y + 5 } ,
456
+ { x : printPosition . x + 10 , y : printPosition . y - 10 } ,
457
+ nativeMenus [ 0 ] ,
458
+ 100 ,
459
+ ) ;
460
+ detectChanges ( ) ;
461
+ flush ( ) ;
469
462
470
- expect ( numEnterEvents ) . toBe ( 4 ) ;
471
- expect ( nativeMenus . length ) . toBe ( 1 ) ;
472
- } ) ,
473
- ) ;
463
+ expect ( numEnterEvents ) . toBe ( 4 ) ;
464
+ expect ( nativeMenus . length ) . toBe ( 1 ) ;
465
+ } ) ) ;
474
466
475
467
it ( 'should close the edit menu after moving towards submenu and stopping' , fakeAsync ( ( ) => {
476
468
openFileMenu ( ) ;
0 commit comments