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