Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmochu committed May 8, 2019
1 parent 3ff16a9 commit c78eae7
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,14 @@ describe('<ApproveActivitiesContainer />', () => {
expect(spy).toHaveBeenCalled();
expect(redemptionReqSpy).toHaveBeenCalled();
});

it('should handle pagination click', () => {
const instance = shallowWrapper.instance();
const data = { selected: 0 };
instance.setState({
currentPage: data.selected + 1,
});
instance.handlePageClick(data);
expect(instance.state.currentPage).toBe(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,14 @@ describe('<ApproveBudgetContainer />', () => {
instance.handleApproveOrRejectClick('2', 'approved');
expect(spy).toHaveBeenCalled();
});

it('should handle pagination click', () => {
const instance = shallowWrapper.instance();
const data = { selected: 0 };
instance.setState({
currentPage: data.selected + 1,
});
instance.handlePageClick(data);
expect(instance.state.currentPage).toBe(1);
});
});
11 changes: 11 additions & 0 deletions src/app/Dashboard/components/tests/DashboardContainer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,15 @@ describe('<DashboardContainer />', () => {
shallowWrapper.find('.button__add').simulate('click');
expect(instance.state.logPoints).toBe(true);
});

it('should handle pagination click', () => {
const { shallowWrapper } = setUpWrapper();
const instance = shallowWrapper.instance();
const data = { selected: 0 };
instance.setState({
currentPage: data.selected + 1,
});
instance.handlePageClick(data);
expect(instance.state.currentPage).toBe(1);
});
});
10 changes: 10 additions & 0 deletions src/app/Societies/components/tests/SocietiesContainer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,14 @@ describe('<SocietiesContainer />', () => {
shallowWrapper.find('.button__add').simulate('click');
expect(instance.state.logPoints).toBe(true);
});

it('should handle pagination click', () => {
const instance = shallowWrapper.instance();
const data = { selected: 0 };
instance.setState({
currentPage: data.selected + 1,
});
instance.handlePageClick(data);
expect(instance.state.currentPage).toBe(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,14 @@ describe('<VerifyActivitiesContainer />', () => {
shallowWrapper.find('.button__add').simulate('click');
expect(instance.state.logPoints).toBe(true);
});

it('should handle pagination click', () => {
const instance = shallowWrapper.instance();
const data = { selected: 0 };
instance.setState({
currentPage: data.selected + 1,
});
instance.handlePageClick(data);
expect(instance.state.currentPage).toBe(1);
});
});

0 comments on commit c78eae7

Please sign in to comment.