@@ -69,14 +69,14 @@ describe('ProfilerContext', () => {
6969
7070 const Contexts = ( {
7171 children = null ,
72- defaultSelectedElementID = null ,
73- defaultSelectedElementIndex = null ,
72+ defaultInspectedElementID = null ,
73+ defaultInspectedElementIndex = null ,
7474 } : any ) => (
7575 < BridgeContext . Provider value = { bridge } >
7676 < StoreContext . Provider value = { store } >
7777 < TreeContextController
78- defaultSelectedElementID = { defaultSelectedElementID }
79- defaultSelectedElementIndex = { defaultSelectedElementIndex } >
78+ defaultInspectedElementID = { defaultInspectedElementID }
79+ defaultInspectedElementIndex = { defaultInspectedElementIndex } >
8080 < ProfilerContextController > { children } </ ProfilerContextController >
8181 </ TreeContextController >
8282 </ StoreContext . Provider >
@@ -225,8 +225,8 @@ describe('ProfilerContext', () => {
225225 await utils . actAsync ( ( ) =>
226226 TestRenderer . create (
227227 < Contexts
228- defaultSelectedElementID = { store . getElementIDAtIndex ( 3 ) }
229- defaultSelectedElementIndex = { 3 } >
228+ defaultInspectedElementID = { store . getElementIDAtIndex ( 3 ) }
229+ defaultInspectedElementIndex = { 3 } >
230230 < ContextReader />
231231 </ Contexts > ,
232232 ) ,
@@ -276,8 +276,8 @@ describe('ProfilerContext', () => {
276276 await utils . actAsync ( ( ) =>
277277 TestRenderer . create (
278278 < Contexts
279- defaultSelectedElementID = { store . getElementIDAtIndex ( 3 ) }
280- defaultSelectedElementIndex = { 3 } >
279+ defaultInspectedElementID = { store . getElementIDAtIndex ( 3 ) }
280+ defaultInspectedElementIndex = { 3 } >
281281 < ContextReader />
282282 </ Contexts > ,
283283 ) ,
@@ -323,8 +323,8 @@ describe('ProfilerContext', () => {
323323 await utils . actAsync ( ( ) =>
324324 TestRenderer . create (
325325 < Contexts
326- defaultSelectedElementID = { store . getElementIDAtIndex ( 3 ) }
327- defaultSelectedElementIndex = { 3 } >
326+ defaultInspectedElementID = { store . getElementIDAtIndex ( 3 ) }
327+ defaultInspectedElementIndex = { 3 } >
328328 < ContextReader />
329329 </ Contexts > ,
330330 ) ,
@@ -374,8 +374,8 @@ describe('ProfilerContext', () => {
374374 await utils . actAsync ( ( ) =>
375375 TestRenderer . create (
376376 < Contexts
377- defaultSelectedElementID = { store . getElementIDAtIndex ( 3 ) }
378- defaultSelectedElementIndex = { 3 } >
377+ defaultInspectedElementID = { store . getElementIDAtIndex ( 3 ) }
378+ defaultInspectedElementIndex = { 3 } >
379379 < ContextReader />
380380 </ Contexts > ,
381381 ) ,
@@ -415,11 +415,12 @@ describe('ProfilerContext', () => {
415415
416416 let context : Context = ( ( null : any ) : Context ) ;
417417 let dispatch : DispatcherContext = ( ( null : any ) : DispatcherContext ) ;
418- let selectedElementID = null ;
418+ let inspectedElementID = null ;
419419 function ContextReader ( ) {
420420 context = React . useContext ( ProfilerContext ) ;
421421 dispatch = React . useContext ( TreeDispatcherContext ) ;
422- selectedElementID = React . useContext ( TreeStateContext ) . selectedElementID ;
422+ inspectedElementID =
423+ React . useContext ( TreeStateContext ) . inspectedElementID ;
423424 return null ;
424425 }
425426
@@ -428,13 +429,15 @@ describe('ProfilerContext', () => {
428429 // Select an element within the second root.
429430 await utils . actAsync ( ( ) =>
430431 TestRenderer . create (
431- < Contexts defaultSelectedElementID = { id } defaultSelectedElementIndex = { 3 } >
432+ < Contexts
433+ defaultInspectedElementID = { id }
434+ defaultInspectedElementIndex = { 3 } >
432435 < ContextReader />
433436 </ Contexts > ,
434437 ) ,
435438 ) ;
436439
437- expect ( selectedElementID ) . toBe ( id ) ;
440+ expect ( inspectedElementID ) . toBe ( id ) ;
438441
439442 // Profile and record more updates to both roots
440443 await utils . actAsync ( ( ) => store . profilerStore . startProfiling ( ) ) ;
@@ -448,7 +451,7 @@ describe('ProfilerContext', () => {
448451 utils . act ( ( ) => dispatch ( { type : 'SELECT_ELEMENT_AT_INDEX' , payload : 0 } ) ) ;
449452
450453 // Verify that the initial Profiler root selection is maintained.
451- expect ( selectedElementID ) . toBe ( otherID ) ;
454+ expect ( inspectedElementID ) . toBe ( otherID ) ;
452455 expect ( context ) . not . toBeNull ( ) ;
453456 expect ( context . rootID ) . toBe ( store . getRootIDForElement ( id ) ) ;
454457 } ) ;
@@ -484,11 +487,12 @@ describe('ProfilerContext', () => {
484487
485488 let context : Context = ( ( null : any ) : Context ) ;
486489 let dispatch : DispatcherContext = ( ( null : any ) : DispatcherContext ) ;
487- let selectedElementID = null ;
490+ let inspectedElementID = null ;
488491 function ContextReader ( ) {
489492 context = React . useContext ( ProfilerContext ) ;
490493 dispatch = React . useContext ( TreeDispatcherContext ) ;
491- selectedElementID = React . useContext ( TreeStateContext ) . selectedElementID ;
494+ inspectedElementID =
495+ React . useContext ( TreeStateContext ) . inspectedElementID ;
492496 return null ;
493497 }
494498
@@ -497,13 +501,15 @@ describe('ProfilerContext', () => {
497501 // Select an element within the second root.
498502 await utils . actAsync ( ( ) =>
499503 TestRenderer . create (
500- < Contexts defaultSelectedElementID = { id } defaultSelectedElementIndex = { 3 } >
504+ < Contexts
505+ defaultInspectedElementID = { id }
506+ defaultInspectedElementIndex = { 3 } >
501507 < ContextReader />
502508 </ Contexts > ,
503509 ) ,
504510 ) ;
505511
506- expect ( selectedElementID ) . toBe ( id ) ;
512+ expect ( inspectedElementID ) . toBe ( id ) ;
507513
508514 // Profile and record more updates to both roots
509515 await utils . actAsync ( ( ) => store . profilerStore . startProfiling ( ) ) ;
@@ -517,7 +523,7 @@ describe('ProfilerContext', () => {
517523 utils . act ( ( ) => dispatch ( { type : 'SELECT_ELEMENT_AT_INDEX' , payload : 0 } ) ) ;
518524
519525 // Verify that the initial Profiler root selection is maintained.
520- expect ( selectedElementID ) . toBe ( otherID ) ;
526+ expect ( inspectedElementID ) . toBe ( otherID ) ;
521527 expect ( context ) . not . toBeNull ( ) ;
522528 expect ( context . rootID ) . toBe ( store . getRootIDForElement ( id ) ) ;
523529 } ) ;
@@ -553,10 +559,11 @@ describe('ProfilerContext', () => {
553559 ` ) ;
554560
555561 let context : Context = ( ( null : any ) : Context ) ;
556- let selectedElementID = null ;
562+ let inspectedElementID = null ;
557563 function ContextReader ( ) {
558564 context = React . useContext ( ProfilerContext ) ;
559- selectedElementID = React . useContext ( TreeStateContext ) . selectedElementID ;
565+ inspectedElementID =
566+ React . useContext ( TreeStateContext ) . inspectedElementID ;
560567 return null ;
561568 }
562569
@@ -567,14 +574,14 @@ describe('ProfilerContext', () => {
567574 </ Contexts > ,
568575 ) ,
569576 ) ;
570- expect ( selectedElementID ) . toBeNull ( ) ;
577+ expect ( inspectedElementID ) . toBeNull ( ) ;
571578
572579 // Select an element in the Profiler tab and verify that the selection is synced to the Components tab.
573580 await utils . actAsync ( ( ) => context . selectFiber ( parentID , 'Parent' ) ) ;
574- expect ( selectedElementID ) . toBe ( parentID ) ;
581+ expect ( inspectedElementID ) . toBe ( parentID ) ;
575582
576583 // Select an unmounted element and verify no Components tab selection doesn't change.
577584 await utils . actAsync ( ( ) => context . selectFiber ( childID , 'Child' ) ) ;
578- expect ( selectedElementID ) . toBe ( parentID ) ;
585+ expect ( inspectedElementID ) . toBe ( parentID ) ;
579586 } ) ;
580587} ) ;
0 commit comments