@@ -2364,7 +2364,9 @@ describe('NavigatorCard', () => {
2364
2364
2365
2365
const fourthItem = items . at ( 3 ) ;
2366
2366
setOffsetParent ( fourthItem . element , { offsetHeight : SIDEBAR_ITEM_SIZE } ) ;
2367
- fourthItem . trigger ( 'focusin' ) ;
2367
+ fourthItem . trigger ( 'focusin' , {
2368
+ relatedTarget : document . body ,
2369
+ } ) ;
2368
2370
await flushPromises ( ) ;
2369
2371
expect ( scrollBySpy ) . toHaveBeenCalledTimes ( 1 ) ;
2370
2372
expect ( scrollBySpy ) . toHaveBeenCalledWith ( {
@@ -2375,7 +2377,9 @@ describe('NavigatorCard', () => {
2375
2377
getChildPositionInScroller . mockReturnValueOnce ( - 1 ) ;
2376
2378
const firstItem = items . at ( 0 ) ;
2377
2379
setOffsetParent ( firstItem . element , { offsetHeight : SIDEBAR_ITEM_SIZE + 50 } ) ;
2378
- firstItem . trigger ( 'focusin' ) ;
2380
+ firstItem . trigger ( 'focusin' , {
2381
+ relatedTarget : document . body ,
2382
+ } ) ;
2379
2383
await flushPromises ( ) ;
2380
2384
expect ( scrollBySpy ) . toHaveBeenCalledTimes ( 2 ) ;
2381
2385
expect ( scrollBySpy ) . toHaveBeenCalledWith ( {
@@ -2391,7 +2395,9 @@ describe('NavigatorCard', () => {
2391
2395
await flushPromises ( ) ;
2392
2396
const button = wrapper . find ( NavigatorCardItem ) . find ( 'button' ) ;
2393
2397
// should be focus, but jsdom does not propagate that
2394
- button . trigger ( 'focusin' ) ;
2398
+ button . trigger ( 'focusin' , {
2399
+ relatedTarget : document . body ,
2400
+ } ) ;
2395
2401
await wrapper . vm . $nextTick ( ) ;
2396
2402
expect ( wrapper . vm . lastFocusTarget ) . toEqual ( button . element ) ;
2397
2403
} ) ;
@@ -2401,7 +2407,9 @@ describe('NavigatorCard', () => {
2401
2407
await flushPromises ( ) ;
2402
2408
const button = wrapper . find ( NavigatorCardItem ) . find ( 'button' ) ;
2403
2409
// should be focus, but jsdom does not propagate that
2404
- button . trigger ( 'focusin' ) ;
2410
+ button . trigger ( 'focusin' , {
2411
+ relatedTarget : document . body ,
2412
+ } ) ;
2405
2413
await wrapper . vm . $nextTick ( ) ;
2406
2414
button . trigger ( 'focusout' , {
2407
2415
relatedTarget : document . body ,
@@ -2414,7 +2422,9 @@ describe('NavigatorCard', () => {
2414
2422
await flushPromises ( ) ;
2415
2423
const button = wrapper . find ( NavigatorCardItem ) . find ( 'button' ) ;
2416
2424
// should be focus, but jsdom does not propagate that
2417
- button . trigger ( 'focusin' ) ;
2425
+ button . trigger ( 'focusin' , {
2426
+ relatedTarget : null ,
2427
+ } ) ;
2418
2428
await wrapper . vm . $nextTick ( ) ;
2419
2429
button . trigger ( 'focusout' , {
2420
2430
relatedTarget : null ,
@@ -2439,7 +2449,9 @@ describe('NavigatorCard', () => {
2439
2449
// This might happen if it deletes an item, that was in focus
2440
2450
const button = wrapper . find ( NavigatorCardItem ) . find ( 'button' ) ;
2441
2451
// should be focus, but jsdom does not propagate that
2442
- button . trigger ( 'focusin' ) ;
2452
+ button . trigger ( 'focusin' , {
2453
+ relatedTarget : document . body ,
2454
+ } ) ;
2443
2455
const focusSpy = jest . spyOn ( button . element , 'focus' ) ;
2444
2456
await flushPromises ( ) ;
2445
2457
// now make the component go away
@@ -2464,7 +2476,9 @@ describe('NavigatorCard', () => {
2464
2476
// This might happen if it deletes an item, that was in focus
2465
2477
const button = wrapper . find ( NavigatorCardItem ) . find ( 'button' ) ;
2466
2478
// should be focus, but jsdom does not propagate that
2467
- button . trigger ( 'focusin' ) ;
2479
+ button . trigger ( 'focusin' , {
2480
+ relatedTarget : document . body ,
2481
+ } ) ;
2468
2482
button . element . focus ( ) ;
2469
2483
// move the spy below the manual focus, so we dont count it
2470
2484
const focusSpy = jest . spyOn ( button . element , 'focus' ) ;
@@ -2484,7 +2498,9 @@ describe('NavigatorCard', () => {
2484
2498
// This might happen if it deletes an item, that was in focus
2485
2499
const button = wrapper . find ( NavigatorCardItem ) . find ( 'button' ) ;
2486
2500
const focusSpy = jest . spyOn ( button . element , 'focus' ) ;
2487
- button . trigger ( 'focusin' ) ;
2501
+ button . trigger ( 'focusin' , {
2502
+ relatedTarget : document . body ,
2503
+ } ) ;
2488
2504
await flushPromises ( ) ;
2489
2505
// trigger an update
2490
2506
wrapper . find ( DynamicScroller ) . vm . $emit ( 'update' ) ;
@@ -2500,7 +2516,9 @@ describe('NavigatorCard', () => {
2500
2516
// This might happen if it deletes an item, that was in focus
2501
2517
const button = wrapper . find ( NavigatorCardItem ) . find ( 'button' ) ;
2502
2518
// should be focus, but jsdom does not propagate that
2503
- button . trigger ( 'focusin' ) ;
2519
+ button . trigger ( 'focusin' , {
2520
+ relatedTarget : document . body ,
2521
+ } ) ;
2504
2522
const focusSpy = jest . spyOn ( button . element , 'focus' ) ;
2505
2523
await flushPromises ( ) ;
2506
2524
// initiate a filter
0 commit comments