mirror of
https://github.com/yldio/copilot.git
synced 2024-11-11 05:40:11 +02:00
increase code coverage
This commit is contained in:
parent
6fbb6f653c
commit
c0099fcc8f
@ -5,8 +5,6 @@ const {
|
||||
Redirect
|
||||
} = ReactRouter;
|
||||
|
||||
module.exports = (to) => () => {
|
||||
return (
|
||||
<Redirect to={to} />
|
||||
);
|
||||
};
|
||||
module.exports = (to) => () => (
|
||||
<Redirect to={to} />
|
||||
);
|
||||
|
@ -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}
|
||||
|
@ -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);
|
||||
|
19
frontend/test/components/project-section.js
Normal file
19
frontend/test/components/project-section.js
Normal 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);
|
||||
});
|
25
frontend/test/components/service.js
Normal file
25
frontend/test/components/service.js
Normal 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);
|
||||
});
|
25
frontend/test/components/services.js
Normal file
25
frontend/test/components/services.js
Normal 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);
|
||||
});
|
Loading…
Reference in New Issue
Block a user