react-paginate
Advanced tools
Comparing version 0.1.20 to 0.1.21
@@ -1,51 +0,48 @@ | ||
/** @jsx React.DOM */ | ||
jest.dontMock('./../react_components/index.js'); | ||
jest.dontMock('./../react_components/PaginationBoxView.js'); | ||
jest.dontMock('./../react_components/PaginationListView.js'); | ||
jest.dontMock('./../react_components/PageView.js'); | ||
/** @jsx React.DOM */ | ||
jest.dontMock('./../react_components/index.js'); | ||
jest.dontMock('./../react_components/PaginationBoxView.jsx'); | ||
jest.dontMock('./../react_components/PaginationListView.jsx'); | ||
jest.dontMock('./../react_components/PageView.jsx'); | ||
var React = require('react/addons'); | ||
var PaginationBoxView = require('./../react_components/PaginationBoxView.js'); | ||
var PaginationListView = require('./../react_components/PaginationListView.js'); | ||
var PageView = require('./../react_components/PageView.js'); | ||
var TestUtils = React.addons.TestUtils; | ||
var React = require('react/addons'); | ||
var PaginationBoxView = require('./../react_components/PaginationBoxView.jsx'); | ||
var PaginationListView = require('./../react_components/PaginationListView.jsx'); | ||
var PageView = require('./../react_components/PageView.jsx'); | ||
var TestUtils = React.addons.TestUtils; | ||
describe('PaginationBoxView', function() { | ||
describe('PaginationBoxView', function() { | ||
var pagination = TestUtils.renderIntoDocument( | ||
<PaginationBoxView /> | ||
); | ||
var pagination = TestUtils.renderIntoDocument( | ||
<PaginationBoxView /> | ||
); | ||
it('should render a pagination component', function() { | ||
expect(pagination.getDOMNode().nodeName).toEqual("UL"); | ||
it('should render a pagination component', function() { | ||
TestUtils.scryRenderedComponentsWithType(pagination, PaginationListView); | ||
expect(pagination.getDOMNode().nodeName).toEqual("UL"); | ||
expect(pagination.getDOMNode().querySelector(".selected a").textContent).toBe("1"); | ||
TestUtils.scryRenderedComponentsWithType(pagination, PaginationListView); | ||
var pages = pagination.getDOMNode().querySelectorAll("li"); | ||
expect(pages.length).toEqual(8); | ||
}); | ||
expect(pagination.getDOMNode().querySelector(".selected a").textContent).toBe("1"); | ||
it('test previous and next buttons', function() { | ||
TestUtils.Simulate.click(TestUtils.findRenderedDOMComponentWithClass(pagination, 'next')); | ||
var pages = pagination.getDOMNode().querySelectorAll("li"); | ||
expect(pages.length).toEqual(8); | ||
}); | ||
expect(pagination.getDOMNode().querySelector(".selected a").textContent).toBe("2"); | ||
it('test previous and next buttons', function() { | ||
TestUtils.Simulate.click(TestUtils.findRenderedDOMComponentWithClass(pagination, 'next')); | ||
TestUtils.Simulate.click(TestUtils.findRenderedDOMComponentWithClass(pagination, 'previous')); | ||
expect(pagination.getDOMNode().querySelector(".selected a").textContent).toBe("2"); | ||
expect(pagination.getDOMNode().querySelector(".selected a").textContent).toBe("1"); | ||
}); | ||
TestUtils.Simulate.click(TestUtils.findRenderedDOMComponentWithClass(pagination, 'previous')); | ||
it('test click on a page item', function() { | ||
TestUtils.findRenderedComponentWithType(pagination, PaginationListView); | ||
expect(pagination.getDOMNode().querySelector(".selected a").textContent).toBe("1"); | ||
}); | ||
var pageItem = pagination.getDOMNode().querySelector("li:nth-child(3)").querySelector("a"); | ||
it('test click on a page item', function() { | ||
TestUtils.findRenderedComponentWithType(pagination, PaginationListView); | ||
TestUtils.Simulate.click(pageItem); | ||
var pageItem = pagination.getDOMNode().querySelector("li:nth-child(3)").querySelector("a"); | ||
TestUtils.Simulate.click(pageItem); | ||
expect(pagination.getDOMNode().querySelector(".selected a").textContent).toBe("3"); | ||
}); | ||
}); | ||
expect(pagination.getDOMNode().querySelector(".selected a").textContent).toBe("3"); | ||
}); | ||
}); |
@@ -21,3 +21,3 @@ 'use strict'; | ||
'sample/**/*.css', | ||
'sample/**/*.js' | ||
'sample/**/*.jsx' | ||
] | ||
@@ -46,3 +46,3 @@ } | ||
gulp.task('watch', function() { | ||
gulp.watch('./react_components/*.js', ['app', 'sample']); | ||
gulp.watch('./react_components/*.jsx', ['app', 'sample']); | ||
gulp.watch('./sample/sample.jsx', ['sample']); | ||
@@ -76,3 +76,3 @@ }); | ||
gulp.task('server:reload', function() { | ||
gulp.watch('./react_components/*.js', ['app', 'sample']); | ||
gulp.watch('./react_components/*.jsx', ['app', 'sample']); | ||
gulp.watch('./sample/sample.jsx', ['sample']); | ||
@@ -79,0 +79,0 @@ }); |
{ | ||
"name": "react-paginate", | ||
"version": "0.1.20", | ||
"version": "0.1.21", | ||
"description": "A ReactJS component that creates a pagination.", | ||
@@ -5,0 +5,0 @@ "main": "./react_components/index.js", |
'use strict'; | ||
module.exports = require('./PaginationBoxView'); | ||
module.exports = require('./PaginationBoxView.jsx'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
244223