1 | import React from 'react';
|
2 | import { render, screen } from '@testing-library/react';
|
3 | import '@testing-library/jest-dom';
|
4 | import { Container } from '..';
|
5 | import {
|
6 | testForChildrenInComponent,
|
7 | testForCustomClass,
|
8 | testForCustomTag,
|
9 | } from '../testUtils';
|
10 |
|
11 | describe('Container', () => {
|
12 | it('should render .container markup', () => {
|
13 | render(<Container data-testid="container" />);
|
14 | expect(screen.getByTestId('container')).toHaveClass('container');
|
15 | });
|
16 |
|
17 | it('should render .container-fluid markup', () => {
|
18 | render(<Container fluid data-testid="container" />);
|
19 | expect(screen.getByTestId('container')).toHaveClass('container-fluid');
|
20 | });
|
21 |
|
22 | it('should render children', () => {
|
23 | testForChildrenInComponent(Container);
|
24 | });
|
25 |
|
26 | it('should pass additional classNames', () => {
|
27 | testForCustomClass(Container);
|
28 | });
|
29 |
|
30 | it('should render custom tag', () => {
|
31 | testForCustomTag(Container);
|
32 | });
|
33 |
|
34 | it('should render responsive breakpoints with string fluid props', () => {
|
35 | render(<Container fluid="md" data-testid="container" />);
|
36 | expect(screen.getByTestId('container')).toHaveClass('container-md');
|
37 | expect(screen.getByTestId('container')).not.toHaveClass('container-fluid');
|
38 | });
|
39 | });
|