Skip to content

Commit

Permalink
Merge pull request #139 from appfolio/updateProgress
Browse files Browse the repository at this point in the history
gt - Update Progress with default props,  story, tests
  • Loading branch information
gthomas-appfolio authored Feb 22, 2017
2 parents 19aea26 + 5dac9fe commit 5e3efee
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/components/Progress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Progress } from 'reactstrap';

Progress.defaultProps = {
...Progress.defaultProps,
animated: true
};

export default Progress;
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import {
Popover,
PopoverContent,
PopoverTitle,
Progress,
Row,
TabContent,
TabPane,
Expand All @@ -79,6 +78,7 @@ import HelpBubble from './components/HelpBubble.js';
import Icon from './components/Icon.js';
import Paginator from './components/Paginator';
import PatternInput from './components/PatternInput.js';
import Progress from './components/Progress.js';
import Select from './components/Select.js';
import Spinner from './components/Spinner.js';
import Steps from './components/Steps.js';
Expand Down Expand Up @@ -146,7 +146,6 @@ export {
Popover,
PopoverContent,
PopoverTitle,
Progress,
Row,
TabContent,
TabPane,
Expand All @@ -171,6 +170,7 @@ export {
HelpBubble,
Icon,
PatternInput,
Progress,
Spinner,
Steps,
SummaryBox,
Expand Down
18 changes: 18 additions & 0 deletions stories/Progress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import { number, select } from '@kadira/storybook-addon-knobs';

import { Progress } from '../src';

storiesOf('Progress', module)
.addWithInfo('Live example', () => (
<Progress
color={select('color', ['info', 'success', 'warning', 'danger'], 'info')}
value={number('value', 50, {
range: true,
min: 0,
max: 100,
step: 1,
})}
/>
));
1 change: 1 addition & 0 deletions stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import './Icon';
import './Alerts';
import './HelpBubble';
import './Modal';
import './Progress';
import './Table';
import './Tooltip';

Expand Down
21 changes: 21 additions & 0 deletions test/components/Progress.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-env mocha */

import 'jsdom-global/register';
import React from 'react';
import assert from 'assert';
import { mount } from 'enzyme';

import { Progress } from '../../src';

describe('<Progress />', () => {
it('should render correctly', () => {
const component = mount(<Progress />);
assert(component);
});

it('should render with the correct default props', () => {
const component = mount(<Progress />);
const props = component.props();
assert.equal(props.animated, true);
});
});

0 comments on commit 5e3efee

Please sign in to comment.