Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Oct 24, 2018
1 parent 390969c commit c66a9e9
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
84 changes: 84 additions & 0 deletions test/__snapshots__/index.test.js.snap
Expand Up @@ -593,3 +593,87 @@ exports[`Pagination should render with no ellipses if not needed - visible == ma
</ul>
</nav>
`;

exports[`Pagination should use boolean flags as classnames 1`] = `
<nav
aria-label="pagination"
className="pagination-container pagination is-rounded is-small is-medium is-large is-centered is-right "
role="navigation"
>
<a
className="pagination-previous nav "
disabled={false}
onClick={[Function]}
>
Previous
</a>
<a
className="pagination-next nav "
disabled={false}
onClick={[Function]}
>
Next page
</a>
<ul
className="pagination-list "
>
<li>
<a
aria-current={false}
aria-label="Goto page 1"
className="pagination-link false"
onClick={[Function]}
>
1
</a>
</li>
<li>
<a
aria-current={false}
aria-label="Goto page 2"
className="pagination-link false"
onClick={[Function]}
>
2
</a>
</li>
<li>
<a
aria-current="page"
aria-label="Goto page 3"
className="pagination-link is-current"
onClick={[Function]}
>
3
</a>
</li>
<li>
<a
aria-current={false}
aria-label="Goto page 4"
className="pagination-link false"
onClick={[Function]}
>
4
</a>
</li>
<li>
<span
className="pagination-ellipsis"
>
</span>
</li>
<li>
<a
aria-current={false}
aria-label="Goto page 10"
className="pagination-link false"
onClick={[Function]}
>
10
</a>
</li>
</ul>
</nav>
`;
18 changes: 18 additions & 0 deletions test/index.test.js
Expand Up @@ -113,6 +113,24 @@ describe('Pagination', () => {
).toMatchSnapshot();
});

test('should use boolean flags as classnames', () => {
expect(
render(
<Pagination
isRounded
isCentered
isLarge
isMedium
isRight
isSmall
pages={10}
currentPage={3}
onChange={() => {}}
/>
)
).toMatchSnapshot();
});

test('should call callback when previous clicked', () => {
const onChange = jest.fn();
const tree = renderer.create(
Expand Down

0 comments on commit c66a9e9

Please sign in to comment.