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', () => {
270270 done ( ) ;
271271 } ) ;
272272
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 => {
274274 const Example = ( ) => null ;
275275
276276 const container = document . createElement ( 'div' ) ;
@@ -311,7 +311,16 @@ describe('InspectedElement', () => {
311311 false ,
312312 ) ;
313313
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+
315324 await utils . actAsync (
316325 ( ) =>
317326 renderer . update (
You can’t perform that action at this time.
0 commit comments