Skip to content

Commit

Permalink
Merge pull request #201 from appfolio/eslintCleanup
Browse files Browse the repository at this point in the history
gt - Reduce some eslint errors, fix tests
  • Loading branch information
gthomas-appfolio authored Apr 27, 2017
2 parents 0f675b0 + edb99f6 commit 2446a97
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
12 changes: 6 additions & 6 deletions src/components/AddressInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AddressInput extends Component {
name="address1"
type="text"
placeholder="Address 1"
{...this.propsFor('address1') }
{...this.propsFor('address1')}
state={error.address1 && 'danger'}
onChange={flow([readEvent, this.onChange])}
disabled={disabled}
Expand All @@ -47,7 +47,7 @@ class AddressInput extends Component {
name="address2"
type="text"
placeholder="Address 2"
{...this.propsFor('address2') }
{...this.propsFor('address2')}
state={error.address2 && 'danger'}
onChange={flow([readEvent, this.onChange])}
disabled={disabled}
Expand All @@ -60,7 +60,7 @@ class AddressInput extends Component {
type="text"
name="city"
placeholder="City"
{...this.propsFor('city') }
{...this.propsFor('city')}
state={error.city && 'danger'}
onChange={flow([readEvent, this.onChange])}
disabled={disabled}
Expand All @@ -74,7 +74,7 @@ class AddressInput extends Component {
name="state"
placeholder="State"
options={US_STATES}
{...this.propsFor('state') }
{...this.propsFor('state')}
onChange={selection => this.onChange({ state: selection && selection.value })}
disabled={disabled}
/>
Expand All @@ -86,7 +86,7 @@ class AddressInput extends Component {
type="text"
name="postal"
placeholder="Zip"
{...this.propsFor('postal') }
{...this.propsFor('postal')}
state={error.postal && 'danger'}
onChange={flow([readEvent, this.onChange])}
disabled={disabled}
Expand All @@ -100,7 +100,7 @@ class AddressInput extends Component {
name="countryCode"
options={COUNTRIES}
placeholder="Country"
{...this.propsFor('countryCode') }
{...this.propsFor('countryCode')}
onChange={selection => this.onChange({ countryCode: selection && selection.value })}
disabled={disabled}
/>
Expand Down
1 change: 0 additions & 1 deletion src/components/Modal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Modal } from 'reactstrap';

Modal.defaultProps = {
Expand Down
1 change: 0 additions & 1 deletion src/components/Waiting.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from 'react';
import { ModalHeader, ModalBody } from 'reactstrap';
import classnames from 'classnames';
import Modal from './Modal';
import Spinner from './Spinner';
Expand Down
11 changes: 6 additions & 5 deletions test/components/BoundFormRow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { shallow } from 'enzyme';

import BoundFormRow from '../../src/components/BoundFormRow';

/* eslint-env mocha */
describe('<BoundFormRow />', () => {
describe('with context', () => {
const onChange = sinon.stub()
, onChangeFactory = name => onChange;
const onChange = sinon.stub();
const onChangeFactory = () => onChange;

const component = shallow(
<BoundFormRow name="firstName" />, {
Expand Down Expand Up @@ -56,8 +57,8 @@ describe('<BoundFormRow />', () => {
});

describe('with defaults', () => {
const onChange = sinon.stub()
, onChangeFactory = name => onChange;
const onChange = sinon.stub();
const onChangeFactory = () => onChange;
const component = shallow(
<BoundFormRow name="firstName" />, { context: { onChange: onChangeFactory } }
);
Expand All @@ -73,7 +74,7 @@ describe('<BoundFormRow />', () => {

describe('with onChange prop', () => {
const spy = sinon.stub();
const onChangeFactory = name => data => { spy(`${name} and ${data}`) };
const onChangeFactory = name => data => { spy(`${name} and ${data}`); };
const onChange = sinon.stub();

const component = shallow(
Expand Down
3 changes: 1 addition & 2 deletions test/components/Waiting.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import assert from 'assert';
import { mount } from 'enzyme';
import { Modal, Spinner, Waiting } from '../../src';

describe.only('<Waiting />', () => {
describe('<Waiting />', () => {
it('should render a modal', () => {
const wrapper = mount(<Waiting />);
const modal = wrapper.find(Modal);
Expand All @@ -26,7 +26,6 @@ describe.only('<Waiting />', () => {

it('uses passed in children', () => {
const wrapper = mount(<Waiting isOpen backdrop><div id="yo">YO...</div></Waiting>);
console.log(wrapper.find('#yo').exists());
assert.equal(false, wrapper.find(Spinner).exists());
});

Expand Down

0 comments on commit 2446a97

Please sign in to comment.