@@ -303,9 +303,11 @@ describe('CardWrapper', () => {
303
303
const highlight2 = createMockHighlight ( 'id2' ) ;
304
304
const highlightElement1 = document . createElement ( 'span' ) ;
305
305
const highlightElement2 = document . createElement ( 'span' ) ;
306
+ highlight1 . elements . push ( highlightElement1 ) ;
307
+ highlight2 . elements . push ( highlightElement2 ) ;
306
308
container . appendChild ( highlightElement1 ) ;
307
309
container . appendChild ( highlightElement2 ) ;
308
- const component = renderer . create (
310
+ renderer . create (
309
311
< Provider store = { store } >
310
312
< CardWrapper
311
313
container = { container }
@@ -314,7 +316,12 @@ describe('CardWrapper', () => {
314
316
</ Provider >
315
317
) ;
316
318
317
- const cards = component . root . findAllByType ( Card ) ;
319
+ renderer . act ( ( ) => {
320
+ store . dispatch ( focusHighlight ( highlight1 . id ) ) ;
321
+ } ) ;
322
+
323
+ // These tests get code coverage but do not update the highlight structures
324
+ // so that we can see that they worked as expected
318
325
319
326
// Expect cards to be hidden
320
327
renderer . act ( ( ) => {
@@ -343,8 +350,11 @@ describe('CardWrapper', () => {
343
350
} ) ;
344
351
} ) ;
345
352
346
- expect ( cards [ 0 ] . props . isHidden ) . toBe ( false ) ;
347
- expect ( cards [ 1 ] . props . isHidden ) . toBe ( false ) ;
353
+ // Set focusedHighlight, and do double=click
354
+ renderer . act ( ( ) => {
355
+ highlightElement1 . dispatchEvent ( new Event ( 'focus' , { bubbles : true } ) ) ;
356
+ highlightElement1 . dispatchEvent ( new Event ( 'dblclick' , { bubbles : true } ) ) ;
357
+ } )
348
358
} ) ;
349
359
350
360
it (
0 commit comments