File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
packages/react-dom/src/__tests__ Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -79,18 +79,19 @@ describe('ReactDOMComponentTree', () => {
7979 } ) ;
8080
8181 it ( 'finds closest instance for node when an event happens' , ( ) => {
82- const elemID = 'aID' ;
83- const innerHTML = { __html : `<div id="${ elemID } "></div>` } ;
84- const testID = 'closestInstance' ;
82+ const nonReactElemID = 'aID' ;
83+ const innerHTML = { __html : `<div id="${ nonReactElemID } "></div>` } ;
84+ const closestInstanceID = 'closestInstance' ;
8585 let currentTargetID = null ;
86+
8687 class ClosestInstance extends React . Component {
8788 _onClick = e => {
8889 currentTargetID = e . currentTarget . id ;
8990 } ;
9091 render ( ) {
9192 return (
9293 < div
93- id = { testID }
94+ id = { closestInstanceID }
9495 onClick = { this . _onClick }
9596 dangerouslySetInnerHTML = { innerHTML }
9697 />
@@ -103,8 +104,8 @@ describe('ReactDOMComponentTree', () => {
103104 ReactDOM . render ( < section > { component } </ section > , container ) ;
104105 document . body . appendChild ( container ) ;
105106 expect ( currentTargetID ) . toBe ( null ) ;
106- simulateClick ( document . getElementById ( elemID ) ) ;
107- expect ( currentTargetID ) . toBe ( testID ) ;
107+ simulateClick ( document . getElementById ( nonReactElemID ) ) ;
108+ expect ( currentTargetID ) . toBe ( closestInstanceID ) ;
108109 } ) ;
109110
110111 it ( 'finds a controlled instance from node and gets its current fiber props' , ( ) => {
You can’t perform that action at this time.
0 commit comments