Socket
Socket
Sign inDemoInstall

react-responsive-carousel

Package Overview
Dependencies
1
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.0.2

43

__tests__/Carousel.js

@@ -42,2 +42,45 @@ /** @jsx React.DOM */

describe("Basics", function () {
describe("changeItem", function () {
beforeEach(function () {
componentInstance.selectItem = jest.genMockFunction();
componentInstance.getFirstItem = jest.genMockFunction().mockReturnValue(2);
componentInstance.changeItem({
target: {
value: 1
}
});
});
it("Should call selectItem sending selectedItem as 1 and firstItem as 2", function () {
expect(componentInstance.selectItem.mock.calls[0][0]).toEqual({
selectedItem: 1,
firstItem: 2
});
});
});
describe("selectItem", function () {
beforeEach(function () {
componentInstance.setState = jest.genMockFunction();
componentInstance.triggerOnChange = jest.genMockFunction();
componentInstance.selectItem({
selectedItem: 1,
ramdomNumber: 2
});
});
it("Should call setState sending the argument received", function () {
expect(componentInstance.setState.mock.calls[0][0]).toEqual({
selectedItem: 1,
ramdomNumber: 2
});
});
it("Should call triggerOnChange sending only selectedItem", function () {
expect(componentInstance.triggerOnChange.mock.calls[0][0]).toBe(1);
});
});
});
it("Should have the right state at the begin", function () {

@@ -44,0 +87,0 @@ expect(componentInstance.state.selectedItem).toBe(0);

4

components/Carousel.js

@@ -262,4 +262,2 @@ var React = require('react');

});
},

@@ -278,3 +276,3 @@

this.setState(state);
this.triggerOnChange(position);
this.triggerOnChange(state.selectedItem);
},

@@ -281,0 +279,0 @@

{
"name": "react-responsive-carousel",
"version": "2.0.1",
"version": "2.0.2",
"description": "React Responsive Carousel",

@@ -5,0 +5,0 @@ "author": {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc