Skip to content

Commit

Permalink
Rename variables to be more semantic
Browse files Browse the repository at this point in the history
  • Loading branch information
GordyD committed Nov 9, 2017
1 parent bb7ccc3 commit f5e404c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/react-dom/src/__tests__/ReactDOMComponentTree-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,19 @@ describe('ReactDOMComponentTree', () => {
});

it('finds closest instance for node when an event happens', () => {
const elemID = 'aID';
const innerHTML = {__html: `<div id="${elemID}"></div>`};
const testID = 'closestInstance';
const nonReactElemID = 'aID';
const innerHTML = {__html: `<div id="${nonReactElemID}"></div>`};
const closestInstanceID = 'closestInstance';
let currentTargetID = null;

class ClosestInstance extends React.Component {
_onClick = e => {
currentTargetID = e.currentTarget.id;
};
render() {
return (
<div
id={testID}
id={closestInstanceID}
onClick={this._onClick}
dangerouslySetInnerHTML={innerHTML}
/>
Expand All @@ -103,8 +104,8 @@ describe('ReactDOMComponentTree', () => {
ReactDOM.render(<section>{component}</section>, container);
document.body.appendChild(container);
expect(currentTargetID).toBe(null);
simulateClick(document.getElementById(elemID));
expect(currentTargetID).toBe(testID);
simulateClick(document.getElementById(nonReactElemID));
expect(currentTargetID).toBe(closestInstanceID);
});

it('finds a controlled instance from node and gets its current fiber props', () => {
Expand Down

0 comments on commit f5e404c

Please sign in to comment.