forked from reactstrap/reactstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListGroup.spec.js
More file actions
36 lines (28 loc) · 1.12 KB
/
Copy pathListGroup.spec.js
File metadata and controls
36 lines (28 loc) · 1.12 KB
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
import React from 'react';
import { shallow } from 'enzyme';
import { ListGroup } from '../';
describe('ListGroup', () => {
it('should render with "list-group" class', () => {
const wrapper = shallow(<ListGroup>Yo!</ListGroup>);
expect(wrapper.text()).toBe('Yo!');
expect(wrapper.hasClass('list-group')).toBe(true);
});
it('should render with "flush"', () => {
const wrapper = shallow(<ListGroup flush>Yo!</ListGroup>);
expect(wrapper.text()).toBe('Yo!');
expect(wrapper.hasClass('list-group')).toBe(true);
expect(wrapper.hasClass('list-group-flush')).toBe(true);
});
it('should render additional classes', () => {
const wrapper = shallow(<ListGroup className="other">Yo!</ListGroup>);
expect(wrapper.text()).toBe('Yo!');
expect(wrapper.hasClass('other')).toBe(true);
expect(wrapper.hasClass('list-group')).toBe(true);
});
it('should render custom tag', () => {
const wrapper = shallow(<ListGroup tag="main">Yo!</ListGroup>);
expect(wrapper.text()).toBe('Yo!');
expect(wrapper.hasClass('list-group')).toBe(true);
expect(wrapper.find('main').length).toBe(1);
});
});