increase code coverage

This commit is contained in:
Sérgio Ramos 2017-01-02 23:32:15 +00:00
parent 6fbb6f653c
commit c0099fcc8f
6 changed files with 79 additions and 8 deletions

View File

@ -5,8 +5,6 @@ const {
Redirect
} = ReactRouter;
module.exports = (to) => () => {
return (
<Redirect to={to} />
);
};
module.exports = (to) => () => (
<Redirect to={to} />
);

View File

@ -30,6 +30,10 @@ const Section = ({
));
const nameLinks = flatten(name.map((part, i) => {
if (!part.name) {
return null;
}
const link = (
<Link key={part.pathname} to={part.pathname}>
{part.name}

View File

@ -15,7 +15,7 @@ const {
projectSectionsSelector
} = selectors;
const OrgSection = ({
const ProjectSection = ({
children,
org = {},
project = {},
@ -49,7 +49,7 @@ const OrgSection = ({
);
};
OrgSection.propTypes = {
ProjectSection.propTypes = {
children: React.PropTypes.node,
org: PropTypes.org,
project: PropTypes.project,
@ -66,4 +66,4 @@ const mapStateToProps = (state, {
module.exports = connect(
mapStateToProps
)(OrgSection);
)(ProjectSection);

View File

@ -0,0 +1,19 @@
const test = require('ava');
const enzyme = require('enzyme');
const React = require('react');
const create = require('../helpers/create');
const {
render
} = enzyme;
const {
withIntl
} = create;
test('renders <ProjectSection> without exploding', (t) => {
const Section = require('@containers/project/section').WrappedComponent;
const wrapper = render(withIntl(<Section />));
t.deepEqual(wrapper.length, 1);
});

View File

@ -0,0 +1,25 @@
const test = require('ava');
const enzyme = require('enzyme');
const React = require('react');
const create = require('../helpers/create');
const {
render
} = enzyme;
const {
withIntl
} = create;
test('renders <Service> without exploding', (t) => {
const Service = require('@containers/service').WrappedComponent;
const wrapper = render(withIntl(<Service />));
t.deepEqual(wrapper.length, 1);
});
test('renders connected <Service> without exploding', (t) => {
const Service = require('@containers/service');
const wrapper = render(create(<Service />));
t.deepEqual(wrapper.length, 1);
});

View File

@ -0,0 +1,25 @@
const test = require('ava');
const enzyme = require('enzyme');
const React = require('react');
const create = require('../helpers/create');
const {
render
} = enzyme;
const {
withIntl
} = create;
test('renders <Services> without exploding', (t) => {
const Services = require('@containers/services').WrappedComponent;
const wrapper = render(withIntl(<Services />));
t.deepEqual(wrapper.length, 1);
});
test('renders connected <Services> without exploding', (t) => {
const Services = require('@containers/services');
const wrapper = render(create(<Services />));
t.deepEqual(wrapper.length, 1);
});