bee-button
Advanced tools
Comparing version 0.0.4 to 0.0.5
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
@@ -21,2 +23,4 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
@@ -28,3 +32,3 @@ | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } | ||
@@ -71,3 +75,3 @@ var propTypes = { | ||
size: '', | ||
type: '', | ||
type: 'primary', | ||
shape: '', | ||
@@ -74,0 +78,0 @@ disabled: false, |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.Button = undefined; | ||
@@ -5,0 +7,0 @@ |
import { Button } from '../src'; | ||
import React, { Component } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
@@ -5,0 +4,0 @@ |
@@ -1,2 +0,2 @@ | ||
var Demo = require('./ButtonDemo'); | ||
let Demo = require('./ButtonDemo'); | ||
ReactDOM.render(<Demo/>, document.getElementById('neouiReactDemo')); |
111
package.json
{ | ||
"name": "bee-button", | ||
"version": "0.0.4", | ||
"description": "tinper-bee button ui component for react", | ||
"keywords": [ | ||
"react", | ||
"react-component", | ||
"bee-button", | ||
"tinper", | ||
"bee", | ||
"button" | ||
], | ||
"engines": { | ||
"node": ">=4.0.0" | ||
}, | ||
"homepage": "https://github.com/tinper-bee/button", | ||
"author": "", | ||
"repository": "http://github.com/tinper-bee/button", | ||
"bugs": "https://github.com/tinper-bee/button/issues", | ||
"license": "MIT", | ||
"main": "./build/index", | ||
"config": { | ||
"port": 3000 | ||
}, | ||
"scripts": { | ||
"dev": "gulp server", | ||
"lint": "./node_modules/.bin/eslint src", | ||
"test": "./node_modules/.bin/mocha --compilers js:babel-core/register --require ./test/setup.js" | ||
}, | ||
"dependencies": { | ||
"classnames": "^2.2.5", | ||
"tinper-bee-core": "^0.0.4" | ||
}, | ||
"devDependencies": { | ||
"babel": "~6.3.26", | ||
"babel-core": "~6.4.0", | ||
"babel-loader": "~6.2.1", | ||
"babel-plugin-add-module-exports": "~0.1.2", | ||
"babel-preset-es2015": "~6.3.13", | ||
"babel-preset-es2015-loose": "~7.0.0", | ||
"babel-preset-react": "~6.3.13", | ||
"babel-preset-stage-1": "~6.3.13", | ||
"browser-sync": "~2.11.0", | ||
"colors": "^1.1.2", | ||
"console-polyfill": "~0.2.1", | ||
"eslint": "^1.10.3", | ||
"eslint-config-airbnb": "^0.1.1", | ||
"eslint-plugin-react": "^5.2.2", | ||
"cross-spawn": "^2.1.5", | ||
"es3ify-loader": "~0.1.0", | ||
"es5-shim": "~4.1.10", | ||
"gulp": "~3.9.0", | ||
"gulp-babel": "~6.1.1", | ||
"gulp-concat": "~2.6.0", | ||
"gulp-es3ify": "0.0.0", | ||
"gulp-just-replace": "~1.0.2", | ||
"gulp-sass": "~2.3.2", | ||
"gulp-sourcemaps": "~1.5.2", | ||
"html-wiring": "~1.2.0", | ||
"inquirer": "^0.12.0", | ||
"react": "~0.14.0", | ||
"react-dom": "~0.14.0", | ||
"webpack": "^1.10.5", | ||
"mocha": "^3.1.0", | ||
"enzyme": "^2.4.1", | ||
"chai": "^3.5.0" | ||
} | ||
} | ||
"name": "bee-button", | ||
"version": "0.0.5", | ||
"description": "tinper-bee button ui component for react", | ||
"keywords": [ | ||
"react", | ||
"react-component", | ||
"bee-button", | ||
"tinper", | ||
"bee", | ||
"button" | ||
], | ||
"engines": { | ||
"node": ">=4.0.0" | ||
}, | ||
"homepage": "https://github.com/tinper-bee/button", | ||
"author": "", | ||
"repository": "http://github.com/tinper-bee/button", | ||
"bugs": "https://github.com/tinper-bee/button/issues", | ||
"license": "MIT", | ||
"main": "./build/index", | ||
"config": { | ||
"port": 6666 | ||
}, | ||
"scripts": { | ||
"dev": "bee-tools run dev", | ||
"build": "bee-tools run build", | ||
"lint": "bee-tools run lint", | ||
"test": "bee-tools run test", | ||
"chrome": "bee-tools run chrome", | ||
"browsers": "bee-tools run browsers", | ||
"pub": "bee-tools run pub" | ||
}, | ||
"dependencies": { | ||
"classnames": "^2.2.5", | ||
"tinper-bee-core": "^0.0.4" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"enzyme": "^2.4.1", | ||
"react": "~0.14.0", | ||
"react-addons-test-utils": "^15.3.2", | ||
"react-dom": "~0.14.0" | ||
} | ||
} |
@@ -48,3 +48,3 @@ import React, { PropTypes } from 'react'; | ||
size: '', | ||
type: '', | ||
type: 'primary', | ||
shape: '', | ||
@@ -51,0 +51,0 @@ disabled: false, |
import React from 'react'; | ||
import {shallow, mount, render} from 'enzyme'; | ||
import {expect} from 'chai'; | ||
import Button from '../src/index'; | ||
import { Button } from '../src/index'; | ||
describe('Enzyme Shallow', function () { | ||
describe('verifiy size', function () { | ||
it('Button should be exist', function () { | ||
@@ -11,10 +11,83 @@ let button = shallow(<Button/>); | ||
}); | ||
it('Button should be lg', function () { | ||
let button = shallow(<Button size="lg" />); | ||
expect(button.hasClass('u-button-lg')).to.equal(true); | ||
}); | ||
it('Button should be sm', function () { | ||
let button = shallow(<Button size="sm" />); | ||
expect(button.hasClass('u-button-sm')).to.equal(true); | ||
}); | ||
it('Button should be xg', function () { | ||
let button = shallow(<Button size="xg" />); | ||
expect(button.hasClass('u-button-xg')).to.equal(true); | ||
}); | ||
}); | ||
describe('Enzyme Render', function () { | ||
describe('verifiy type', function () { | ||
it('Button should be primary', function () { | ||
let button = shallow(<Button type="primary" />); | ||
expect(button.hasClass('u-button-primary')).to.equal(true); | ||
}); | ||
it('Button should be accent', function () { | ||
let button = shallow(<Button type="accent" />); | ||
expect(button.hasClass('u-button-accent')).to.equal(true); | ||
}); | ||
it('Button should be success', function () { | ||
let button = shallow(<Button type="success" />); | ||
expect(button.hasClass('u-button-success')).to.equal(true); | ||
}); | ||
it('Button should be info', function () { | ||
let button = shallow(<Button type="info" />); | ||
expect(button.hasClass('u-button-info')).to.equal(true); | ||
}); | ||
it('Button should be warning', function () { | ||
let button = shallow(<Button type="warning" />); | ||
expect(button.hasClass('u-button-warning')).to.equal(true); | ||
}); | ||
it('Button should be danger', function () { | ||
let button = shallow(<Button type="danger" />); | ||
expect(button.hasClass('u-button-danger')).to.equal(true); | ||
}); | ||
}); | ||
describe('verifiy shape', function () { | ||
it('Button should be block', function () { | ||
let button = shallow(<Button shape="block" />); | ||
expect(button.hasClass('u-button-block')).to.equal(true); | ||
}); | ||
it('Button should be round', function () { | ||
let button = shallow(<Button shape="round" />); | ||
expect(button.hasClass('u-button-round')).to.equal(true); | ||
}); | ||
it('Button should be squared', function () { | ||
let button = shallow(<Button shape="squared" />); | ||
expect(button.hasClass('u-button-squared')).to.equal(true); | ||
}); | ||
it('Button should be floating', function () { | ||
let button = shallow(<Button shape="floating" />); | ||
expect(button.hasClass('u-button-floating')).to.equal(true); | ||
}); | ||
it('Button should be pillRight', function () { | ||
let button = shallow(<Button shape="pillRight" />); | ||
expect(button.hasClass('u-button-pill-right')).to.equal(true); | ||
}); | ||
it('Button should be pillLeft', function () { | ||
let button = shallow(<Button shape="pillLeft"/>); | ||
expect(button.hasClass('u-button-pill-left')).to.equal(true); | ||
}); | ||
describe('Enzyme Mount', function () { | ||
}); | ||
describe('Button click', function () { | ||
it('Button click change type', function () { | ||
let typeChange = "primary"; | ||
function clickEvent (event) { | ||
typeChange = "accent"; | ||
} | ||
let button = shallow(<Button onClick={ clickEvent } type = { typeChange } />); | ||
button.simulate('click'); | ||
expect(typeChange == "accent").to.equal(true); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
101505
5
34
1087
1
182
1