UNPKG

1.09 kBJavaScriptView Raw
1import React from 'react';
2import { render, screen } from '@testing-library/react';
3import '@testing-library/jest-dom';
4import { Row } from '..';
5import {
6 testForChildrenInComponent,
7 testForCustomClass,
8 testForDefaultClass,
9} from '../testUtils';
10
11describe('Row', () => {
12 it('should render .row markup', () => {
13 testForDefaultClass(Row, 'row');
14 });
15
16 it('should render children', () => {
17 testForChildrenInComponent(Row);
18 });
19
20 it('should pass additional classNames', () => {
21 testForCustomClass(Row);
22 });
23
24 it('show render noGutters class as gx-0', () => {
25 render(<Row noGutters data-testid="row" />);
26 expect(screen.getByTestId('row')).toHaveClass('gx-0 row');
27 });
28
29 it('should pass row col size specific classes as strings', () => {
30 render(<Row sm="6" data-testid="row" />);
31 expect(screen.getByTestId('row')).toHaveClass('row-cols-sm-6');
32 });
33
34 it('should pass row col size specific classes as numbers', () => {
35 render(<Row sm={6} data-testid="row" />);
36 expect(screen.getByTestId('row')).toHaveClass('row-cols-sm-6');
37 });
38});