Skip to content

Commit 853654e

Browse files
committed
Make mock class "smaller" (#110)
1 parent 213e243 commit 853654e

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/components/__tests__/Tabs-test.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -297,23 +297,8 @@ describe('react-tabs', () => {
297297

298298
it('should switch tabs if setState is called within onSelect', () => {
299299
class Wrap extends React.Component {
300-
constructor(props, state) {
301-
super(props, state);
302-
303-
this.state = {
304-
foo: 'foo',
305-
};
306-
307-
this.handleSelect = this.handleSelect.bind(this);
308-
}
309-
310-
handleSelect() {
311-
this.setState({ foo: 'bar' });
312-
}
313-
314-
render() {
315-
return createTabs({ onSelect: this.handleSelect });
316-
}
300+
handleSelect = () => this.setState({ foo: 'bar' });
301+
render() { return createTabs({ onSelect: this.handleSelect }); }
317302
}
318303

319304
const wrapper = mount(<Wrap />);

0 commit comments

Comments
 (0)