1 | import React from 'react';
|
2 | import { render, screen } from '@testing-library/react';
|
3 | import { List } from '..';
|
4 | import {
|
5 | testForCustomClass,
|
6 | testForCustomTag,
|
7 | testForDefaultTag,
|
8 | } from '../testUtils';
|
9 |
|
10 | describe('List', () => {
|
11 | it('should render with "ul" tag', () => {
|
12 | testForDefaultTag(List, 'ul');
|
13 | });
|
14 |
|
15 | it('should render with "list-inline" class when type is "inline"', () => {
|
16 | render(<List type="inline">Yo!</List>);
|
17 |
|
18 | expect(screen.getByText('Yo!')).toHaveClass('list-inline');
|
19 | });
|
20 |
|
21 | it('should render with "list-unstyled" class when type is "unstyled"', () => {
|
22 | render(<List type="unstyled">Yo!</List>);
|
23 |
|
24 | expect(screen.getByText('Yo!')).toHaveClass('list-unstyled');
|
25 | });
|
26 |
|
27 | it('should render additional classes', () => {
|
28 | testForCustomClass(List);
|
29 | });
|
30 |
|
31 | it('should render custom tag', () => {
|
32 | testForCustomTag(List);
|
33 | });
|
34 | });
|