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