react-responsive-carousel
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -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); |
@@ -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": { |
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
75072
1219