UNPKG

896 BJavaScriptView Raw
1import React from 'react';
2import { render, screen } from '@testing-library/react';
3import { PaginationItem } from '..';
4import {
5 testForCustomTag,
6 testForDefaultClass,
7 testForDefaultTag,
8} from '../testUtils';
9
10describe('PaginationItem', () => {
11 it('should render default tag', () => {
12 testForDefaultTag(PaginationItem, 'li');
13 });
14
15 it('should render custom tag', () => {
16 testForCustomTag(PaginationItem);
17 });
18
19 it('should render with "page-item" class', () => {
20 testForDefaultClass(PaginationItem, 'page-item');
21 });
22
23 it('should render active state', () => {
24 render(<PaginationItem active>hello</PaginationItem>);
25 expect(screen.getByText('hello')).toHaveClass('active');
26 });
27
28 it('should render disabled state', () => {
29 render(<PaginationItem disabled>hello</PaginationItem>);
30 expect(screen.getByText('hello')).toHaveClass('disabled');
31 });
32});