Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests; prettier
  • Loading branch information
jquense committed Jul 12, 2017
commit 15228e8b5f9d056d475955a54723cd906ffa5619
3 changes: 2 additions & 1 deletion fixtures/dom/src/components/TestCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class TestCase extends React.Component {
{introducedIn && <dt>First broken in: </dt>}
{introducedIn &&
<dd>
<a href={'https://github.com/facebook/react/tag/v' + introducedIn}>
<a
href={'https://github.com/facebook/react/tag/v' + introducedIn}>
<code>{introducedIn}</code>
</a>
</dd>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ class RadioGroupFixture extends React.Component {
}

handleChange = () => {
this.setState(({ changeCount }) => {
this.setState(({changeCount}) => {
return {
changeCount: changeCount + 1
}
})
}
changeCount: changeCount + 1,
};
});
};

handleReset = () => {
this.setState({
changeCount: 0,
})
}
});
};

render() {
const { changeCount } = this.state;
const {changeCount} = this.state;
const color = changeCount === 2 ? 'green' : 'red';

return (
Expand All @@ -35,27 +35,23 @@ class RadioGroupFixture extends React.Component {
<input
defaultChecked
name="foo"
type='radio'
type="radio"
onChange={this.handleChange}
/>
Radio 1
</label>
<label>
<input
name="foo"
type='radio'
onChange={this.handleChange}
/>
<input name="foo" type="radio" onChange={this.handleChange} />
Radio 2
</label>

{' '}
<p style={{ color }}>
<p style={{color}}>
<code>onChange</code>{' calls: '}<strong>{changeCount}</strong>
</p>
<button onClick={this.handleReset}>Reset count</button>
</Fixture>
)
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ class InputChangeEvents extends React.Component {
Radio inputs should fire change events when the value moved to
another named input
`}
introducedIn="15.6.0"
>
introducedIn="15.6.0">
<TestCase.Steps>
<li>Click on the "Radio 2"</li>
<li>Click back to "Radio 1"</li>
Expand Down
8 changes: 2 additions & 6 deletions src/renderers/dom/shared/__tests__/inputValueTracking-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,11 @@ describe('inputValueTracking', () => {
it('should stop tracking', () => {
inputValueTracking.track(mockComponent);

expect(mockComponent._wrapperState.hasOwnProperty('valueTracker')).toBe(
true,
);
expect(mockComponent._wrapperState.valueTracker).not.toEqual(null);

inputValueTracking.stopTracking(mockComponent);

expect(mockComponent._wrapperState.hasOwnProperty('valueTracker')).toBe(
false,
);
expect(mockComponent._wrapperState.valueTracker).toEqual(null);

expect(input.hasOwnProperty('value')).toBe(false);
});
Expand Down