Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-bootstrap-toggle

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-bootstrap-toggle - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

28

__test__/toggle.test.jsx

@@ -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 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc