react-bootstrap-toggle
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -8,4 +8,2 @@ import React from 'react'; | ||
describe('<Toggle />', () => { | ||
it('should know margin of error is one', () => { | ||
@@ -26,2 +24,3 @@ expect(util.compareWithMarginOfError(99, 100)).toBe(true); | ||
); | ||
wrapper.update(); | ||
util.compareWithMarginOfError.restore(); | ||
@@ -51,4 +50,6 @@ }); | ||
); | ||
wrapper.setProps({ active: false, off: 'yes'}); | ||
util.compareWithMarginOfError.restore(); | ||
}); | ||
@@ -86,26 +87,13 @@ it('should resize click events', () => { | ||
wrapper.simulate('click'); | ||
expect(active).toBe(false); | ||
wrapper.setProps({ disabled: true }); | ||
wrapper.simulate('click'); | ||
expect(active).toBe(false); | ||
}); | ||
it('should render text nodes', () => { | ||
it('should return 0 when the createRange is not a function', () => { | ||
let spy = sinon.stub(util, 'compareWithMarginOfError').returns(true); | ||
let spy = sinon.stub(util, 'getDimension').returns({ width: 50, height: 50}); | ||
// let stub = sinon.stub(global.document, 'createRange' ).returns(true); | ||
document.createRange = () => { | ||
return { | ||
selectNodeContents() { | ||
document.createRange = 42; | ||
}, | ||
getBoundingClientRect() { | ||
} | ||
} | ||
} | ||
const wrapper = mount( | ||
@@ -118,7 +106,5 @@ <Toggle | ||
); | ||
expect(document.createRange).toBeDefined(); | ||
util.getDimension.restore(); | ||
util.compareWithMarginOfError.restore(); | ||
}); | ||
}); |
{ | ||
"name": "react-bootstrap-toggle", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A React version of the bootstrap-toggle without the JQuery dependency", | ||
@@ -5,0 +5,0 @@ "main": "./dist/react-bootstrap-toggle.js", |
## React-Bootstrap-Toggle | ||
[![Build Status](https://travis-ci.org/arnthor3/react-bootstrap-toggle.svg?branch=master)](https://travis-ci.org/arnthor3/react-bootstrap-toggle) | ||
[![Coverage Status](https://coveralls.io/repos/github/arnthor3/react-bootstrap-toggle/badge.svg?branch=master)](https://coveralls.io/github/arnthor3/react-bootstrap-toggle?branch=master) | ||
This is a react component of the http://www.bootstraptoggle.com/ project. | ||
@@ -41,7 +42,11 @@ | ||
<form> | ||
<input type="text"> | ||
<input type="number"> | ||
<SomeInput something={true} /> | ||
..... | ||
<Toggle | ||
onClick={this.onToggle} | ||
on={<h2>ON</h2>} | ||
off={<h2>OFF</h2>} | ||
size="large" | ||
offstyle="danger" | ||
active={this.state.toggleActive} | ||
/> | ||
@@ -54,7 +59,2 @@ </form> | ||
ReactDOM.render(<ReactBootstrapToggle | ||
on={on} | ||
off={off} | ||
active={false} | ||
onChange={onChange} />, document.getElementById('app') ); | ||
@@ -61,0 +61,0 @@ ``` |
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
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
0
27972
725