Skip to content

Commit

Permalink
remove createClass in tests (#2586)
Browse files Browse the repository at this point in the history
* remove createClass in tests

* fix-lint
  • Loading branch information
jquense committed Apr 24, 2017
1 parent 5d3a9e8 commit d4f7d31
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions test/CollapseSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('<Collapse>', () => {

beforeEach(() => {

Component = React.createClass({
Component = class extends React.Component {
render() {
let { children, ...props } = this.props;

Expand All @@ -29,7 +29,7 @@ describe('<Collapse>', () => {
</Collapse>
);
}
});
};
});

it('Should default to collapsed', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/FadeSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Fade', () => {

beforeEach(() => {

Component = React.createClass({
Component = class extends React.Component {
render() {
let { children, ...props } = this.props;

Expand All @@ -24,7 +24,7 @@ describe('Fade', () => {
</Fade>
);
}
});
};
});

it('Should default to hidden', () => {
Expand Down
8 changes: 4 additions & 4 deletions test/ListGroupSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ describe('<ListGroup>', () => {

describe('Some or all children are user-defined custom components', () => {
it('Should output a div by default when children are custom components', () => {
let CustomComponent = React.createClass({
class CustomComponent extends React.Component {
render() {
return (
<li>
<ListGroupItem>{this.props.children}</ListGroupItem>
</li>
);
}
});
}

let instance = ReactTestUtils.renderIntoDocument(
<ListGroup id="testItem">
Expand All @@ -174,15 +174,15 @@ describe('<ListGroup>', () => {
});

it('Should use a "componentClass" prop if specified if any children are custom components', () => {
let CustomComponent = React.createClass({
class CustomComponent extends React.Component {
render() {
return (
<li>
<ListGroupItem>{this.props.children}</ListGroupItem>
</li>
);
}
});
}

let instance = ReactTestUtils.renderIntoDocument(
<ListGroup
Expand Down
8 changes: 4 additions & 4 deletions test/utils/bootstrapUtilsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ describe('bootstrapUtils', () => {
shouldWarn('expected one of ["minimal","boss","plaid","tweed"]');

const Component = bsStyles(['minimal', 'boss', 'plaid', 'tweed'], 'plaid')(
React.createClass({
class extends React.Component {
render() { return <span />; }
})
}
);

const instance = render(<Component />);
Expand Down Expand Up @@ -196,9 +196,9 @@ describe('bootstrapUtils', () => {
shouldWarn('expected one of ["smallish","micro","planet","big"]');

const Component = bsSizes(['smallish', 'micro', 'planet', 'big'], 'smallish')(
React.createClass({
class extends React.Component {
render() { return <span />; }
})
}
);

const instance = render(<Component />);
Expand Down

0 comments on commit d4f7d31

Please sign in to comment.