Commit b77cef52 by jaebradley

fix(eslint): fix Node 6 eslint errors

parent c20de7c3
...@@ -51,10 +51,6 @@ ModalWrapper.propTypes = { ...@@ -51,10 +51,6 @@ ModalWrapper.propTypes = {
body: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired, body: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
}; };
ModalWrapper.defaultProps = {
open: false,
};
storiesOf('Modal', module) storiesOf('Modal', module)
.add('basic usage', () => ( .add('basic usage', () => (
<Modal <Modal
......
...@@ -89,13 +89,12 @@ class Modal extends React.Component { ...@@ -89,13 +89,12 @@ class Modal extends React.Component {
} }
renderBody() { renderBody() {
let body; let { body } = this.props;
if (typeof this.props.body === 'string') { if (typeof body === 'string') {
body = <p>{this.props.body}</p>; body = <p>{body}</p>;
} else {
body = this.props.body;
} }
return body; return body;
} }
......
...@@ -117,10 +117,7 @@ describe('<StatusAlert />', () => { ...@@ -117,10 +117,7 @@ describe('<StatusAlert />', () => {
}); });
describe('focus functions properly', () => { describe('focus functions properly', () => {
it('focus function changes focus', () => { it('focus function changes focus', () => {
wrapper = mount(<div> wrapper = mount(<div><Button label="test" /><StatusAlert {...defaultProps} /></div>);
<Button label="test" />
<StatusAlert {...defaultProps} />
</div>);
const buttons = wrapper.find('button'); const buttons = wrapper.find('button');
......
...@@ -12,9 +12,15 @@ const props = { ...@@ -12,9 +12,15 @@ const props = {
{ key: 'i', label: 'Imaginary Number' }, { key: 'i', label: 'Imaginary Number' },
], ],
data: [ data: [
{ sq: 1, num: 1, x2: 2, i: 'i' }, {
{ sq: 4, num: 2, x2: 4, i: '2i' }, sq: 1, num: 1, x2: 2, i: 'i',
{ sq: 9, num: 3, x2: 6, i: '3i' }, },
{
sq: 4, num: 2, x2: 4, i: '2i',
},
{
sq: 9, num: 3, x2: 6, i: '3i',
},
], ],
}; };
...@@ -62,7 +68,7 @@ describe('<Table />', () => { ...@@ -62,7 +68,7 @@ describe('<Table />', () => {
it('with data in the same order as the columns', () => { it('with data in the same order as the columns', () => {
wrapper.find('tr').at(1).find('td').forEach((td, i) => { wrapper.find('tr').at(1).find('td').forEach((td, i) => {
let parsed = Number(td.text()); let parsed = Number(td.text());
if (isNaN(parsed)) { parsed = td.text(); } if (Number.isNaN(parsed)) { parsed = td.text(); }
expect(parsed).toEqual(props.data[0][props.columns[i].key]); expect(parsed).toEqual(props.data[0][props.columns[i].key]);
}); });
}); });
......
// TODO: @jaebradley fix these eslint errors
/* eslint-disable jsx-a11y/click-events-have-key-events */
/* eslint-disable jsx-a11y/anchor-is-valid */
import React from 'react'; import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment