Skip to content

Commit

Permalink
more tests, package.json: local is better than global
Browse files Browse the repository at this point in the history
  • Loading branch information
Yury Dymov committed Sep 15, 2016
1 parent 9e3bb5c commit 09fa99c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package.json
@@ -1,12 +1,12 @@
{
"name": "react-bootstrap-button-loader",
"version": "1.0.6",
"version": "1.0.7",
"description": "React ButtonLoader with Bootstrap flavor",
"main": "dist/index.js",
"scripts": {
"release": "webpack --verbose --colors --display-error-details --config webpack.release.js -p",
"test": "node node_modules/mocha/bin/mocha --compilers js:babel-core/register",
"coverage": "istanbul cover _mocha -- --compilers js:babel-core/register"
"release": "./node_modules/.bin/webpack --verbose --colors --display-error-details --config webpack.release.js -p",
"test": "./node_modules/.bin/mocha --compilers js:babel-core/register",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --compilers js:babel-core/register"
},
"repository": {
"type": "git",
Expand Down
17 changes: 13 additions & 4 deletions test/ButtonLoader.spec.js
Expand Up @@ -114,20 +114,29 @@ describe('children prop is used', () => {
});
});

describe('bsStyle prop is propagated', () => {
describe('bsStyle, spinColor, style and className props are propagated', () => {

it('bsStyle: success -> .btn-success', () => {
const component = render(<ButtonLoader bsStyle="success" children="Press me" />);

expect(component.find('.btn-success')).to.have.length(1);
});
});

describe('spinColor prop is propagated', () => {

it('expect Spinner to have color #333', () => {
const component = mount(<ButtonLoader children="Press me" loading spinColor="#333" />);

expect(component.find(Spinner).props().spinColor).to.equal('#333');
});

it('className: "temp"', () => {
const component = render(<ButtonLoader className="temp" />);

expect(component).to.have.attr('class').match(/temp/);
});

it('style: {{ zIndex: "-9999" }}', () => {
const component = render(<ButtonLoader style={{ zIndex: '-9999' }} />);

expect(component).to.have.attr('style').match(/\-9999/);
});
});

0 comments on commit 09fa99c

Please sign in to comment.