@@ -291,14 +291,18 @@ test('avoid unnecessary re-rendering', async () => {
291
291
} ;
292
292
293
293
const timeout = 500 ;
294
- const { container, getByTestId } = render (
294
+ const { container : containerElement , getByTestId } = render (
295
295
< div >
296
296
< ClickView recurseCount = { 3 } />
297
297
< ClickButtonAdd />
298
298
< ClickButtonReset />
299
299
</ div > ,
300
300
) ;
301
301
302
+ // https://github.com/testing-library/react-testing-library/issues/841
303
+ // https://github.com/testing-library/dom-testing-library/pull/834
304
+ const container : HTMLElement = containerElement as HTMLElement ;
305
+
302
306
// each element's renderer and effect should have been called once
303
307
expect ( getByTestId ( 'render-clicks-3' ) . textContent ) . toBe ( 'clicks: 0' ) ;
304
308
expect ( getByTestId ( 'render-clicks-2' ) . textContent ) . toBe ( 'clicks: 0' ) ;
@@ -447,14 +451,18 @@ test('avoid unnecessary re-rendering with just setters and state consumers', asy
447
451
} ;
448
452
449
453
const timeout = 500 ;
450
- const { container, getByTestId } = render (
454
+ const { container : containerElement , getByTestId } = render (
451
455
< div >
452
456
< ClickView recurseCount = { 3 } />
453
457
< ClickButtonAdd />
454
458
< ClickButtonReset />
455
459
</ div > ,
456
460
) ;
457
461
462
+ // https://github.com/testing-library/react-testing-library/issues/841
463
+ // https://github.com/testing-library/dom-testing-library/pull/834
464
+ const container : HTMLElement = containerElement as HTMLElement ;
465
+
458
466
// each element's renderer and effect should have been called once
459
467
expect ( getByTestId ( 'render-clicks-3' ) . textContent ) . toBe ( 'clicks: 0' ) ;
460
468
expect ( getByTestId ( 'render-clicks-2' ) . textContent ) . toBe ( 'clicks: 0' ) ;
@@ -611,7 +619,7 @@ test('update same state multiple times', async () => {
611
619
} ;
612
620
613
621
const timeout = 500 ;
614
- const { container, getByTestId } = render (
622
+ const { container : containerElement , getByTestId } = render (
615
623
< div >
616
624
< View id = { 1 } />
617
625
< IncA />
@@ -621,6 +629,10 @@ test('update same state multiple times', async () => {
621
629
</ div > ,
622
630
) ;
623
631
632
+ // https://github.com/testing-library/react-testing-library/issues/841
633
+ // https://github.com/testing-library/dom-testing-library/pull/834
634
+ const container : HTMLElement = containerElement as HTMLElement ;
635
+
624
636
expect ( getByTestId ( 'inc-c' ) . textContent ) . toBe ( 'inc 10' ) ;
625
637
expect ( getByTestId ( 'view-1' ) . textContent ) . toBe ( 'a: 1, b: 6, c: 11' ) ;
626
638
expect ( getByTestId ( 'view-2' ) . textContent ) . toBe ( 'a: 1, b: 6, c: 11' ) ;
0 commit comments