@@ -335,7 +335,8 @@ describe('Hoverifier', () => {
335335 for ( const codeView of testcases ) {
336336 const scheduler = new TestScheduler ( ( a , b ) => chai . assert . deepEqual ( a , b ) )
337337
338- const delayTime = LOADER_DELAY + 100
338+ const hoverDelayTime = 100
339+ const actionsDelayTime = 150
339340 const hover = { }
340341 const actions = [ 'foo' , 'bar' ]
341342
@@ -344,8 +345,8 @@ describe('Hoverifier', () => {
344345 closeButtonClicks : new Observable < MouseEvent > ( ) ,
345346 hoverOverlayElements : of ( null ) ,
346347 hoverOverlayRerenders : EMPTY ,
347- fetchHover : createStubHoverFetcher ( hover , delayTime ) ,
348- fetchActions : createStubActionsFetcher ( actions , delayTime ) ,
348+ fetchHover : createStubHoverFetcher ( hover , LOADER_DELAY + hoverDelayTime ) ,
349+ fetchActions : createStubActionsFetcher ( actions , LOADER_DELAY + actionsDelayTime ) ,
349350 } )
350351
351352 const positionJumps = new Subject < PositionJump > ( )
@@ -370,24 +371,21 @@ describe('Hoverifier', () => {
370371 actionsOrError,
371372 hoverOrError,
372373 } ) ) ,
373- distinctUntilChanged ( ( a , b ) => isEqual ( a , b ) ) ,
374- // For this test, filter out the intermediate emissions where exactly one of the fetchers is
375- // loading.
376- filter (
377- ( { actionsOrError, hoverOrError } ) =>
378- ( actionsOrError === LOADING ) === ( hoverOrError === LOADING )
379- )
374+ distinctUntilChanged ( ( a , b ) => isEqual ( a , b ) )
380375 )
381376
382377 const inputDiagram = 'a'
383378
384379 // Subtract 1ms before "b" because "a" takes up 1ms.
385- const outputDiagram = `${ LOADER_DELAY } ms a ${ TOOLTIP_DISPLAY_DELAY - 1 } ms b`
380+ const outputDiagram = `${ LOADER_DELAY } ms ${ hoverDelayTime } ms a ${ actionsDelayTime -
381+ hoverDelayTime -
382+ 1 } ms b`
386383
387384 const outputValues : {
388385 [ key : string ] : Pick < HoverOverlayProps < { } , { } , string > , 'hoverOrError' | 'actionsOrError' >
389386 } = {
390- a : { hoverOrError : LOADING , actionsOrError : LOADING } , // actions is undefined when it is loading
387+ // No hover is shown if it would just consist of LOADING.
388+ a : { hoverOrError : createHoverAttachment ( hover ) , actionsOrError : LOADING } ,
391389 b : { hoverOrError : createHoverAttachment ( hover ) , actionsOrError : actions } ,
392390 }
393391
0 commit comments