Skip to content

Commit

Permalink
Stateless Component integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdustan committed Oct 7, 2015
1 parent fdabdfd commit e4c867c
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions src/__tests__/main-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,81 @@ describe('main', () => {
`);
});

describe('Stateless Component definition: ArrowFunctionExpression', () => {
test(`
import React, {PropTypes} from "React";
/**
* Example component description
*/
let Component = props => <div />;
Component.displayName = 'ABC';
Component.defaultProps = {
foo: true
};
Component.propTypes = {
/**
* Example prop description
*/
foo: PropTypes.bool
};
export default Component;
`);
});

describe('Stateless Component definition: FunctionDeclaration', () => {
test(`
import React, {PropTypes} from "React";
/**
* Example component description
*/
function Component (props) {
return <div />;
}
Component.displayName = 'ABC';
Component.defaultProps = {
foo: true
};
Component.propTypes = {
/**
* Example prop description
*/
foo: PropTypes.bool
};
export default Component;
`);
});

describe('Stateless Component definition: FunctionExpression', () => {
test(`
import React, {PropTypes} from "React";
/**
* Example component description
*/
let Component = function(props) {
return React.createElement('div', null);
}
Component.displayName = 'ABC';
Component.defaultProps = {
foo: true
};
Component.propTypes = {
/**
* Example prop description
*/
foo: PropTypes.bool
};
export default Component;
`);
});
});

0 comments on commit e4c867c

Please sign in to comment.