/
Row.spec.js
49 lines (35 loc) · 1.33 KB
/
Row.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React from 'react';
import { shallow } from 'enzyme';
import { Row } from '../';
describe('Row', () => {
it('should render .row markup', () => {
const wrapper = shallow(<Row />);
expect(wrapper.html()).toBe('<div class="row"></div>');
});
it('should render children', () => {
const wrapper = shallow(<Row>Children</Row>);
expect(wrapper.html()).toBe('<div class="row">Children</div>');
});
it('should pass additional classNames', () => {
const wrapper = shallow(<Row className="extra" />);
expect(wrapper.hasClass('extra')).toBe(true);
expect(wrapper.hasClass('row')).toBe(true);
});
it('show render noGutters class as gx-0', () => {
const wrapper = shallow(<Row noGutters />);
expect(wrapper.hasClass('gx-0')).toBe(true);
expect(wrapper.hasClass('row')).toBe(true);
});
it('show render form classes', () => {
const wrapper = shallow(<Row form />);
expect(wrapper.html()).toBe('<div class="form-row"></div>');
});
it('should pass row col size specific classes as strings', () => {
const wrapper = shallow(<Row sm="6" />);
expect(wrapper.hasClass('row-cols-sm-6')).toBe(true);
});
it('should pass row col size specific classes as numbers', () => {
const wrapper = shallow(<Row sm={6} />);
expect(wrapper.hasClass('row-cols-sm-6')).toBe(true);
});
});