File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
packages/react-devtools-shared/src/__tests__ Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ describe('InspectedElement', () => {
270
270
done ( ) ;
271
271
} ) ;
272
272
273
- xit ( 'should poll for updates for the currently selected element' , async done => {
273
+ it ( 'should poll for updates for the currently selected element' , async done => {
274
274
const Example = ( ) => null ;
275
275
276
276
const container = document . createElement ( 'div' ) ;
@@ -311,7 +311,16 @@ describe('InspectedElement', () => {
311
311
false ,
312
312
) ;
313
313
314
- inspectedElement = null ;
314
+ // TODO (cache)
315
+ // This test only passes if both the check-for-updates poll AND the test renderer.update() call are included below.
316
+ // It seems like either one of the two should be sufficient but:
317
+ // 1. Running only check-for-updates schedules a transition that React never renders.
318
+ // 2. Running only renderer.update() loads stale data (first props)
319
+
320
+ // Wait for our check-for-updates poll to get the new data.
321
+ jest . runOnlyPendingTimers ( ) ;
322
+ await Promise . resolve ( ) ;
323
+
315
324
await utils . actAsync (
316
325
( ) =>
317
326
renderer . update (
You can’t perform that action at this time.
0 commit comments