-
Notifications
You must be signed in to change notification settings - Fork 321
/
Copy pathpanel-test.js
92 lines (75 loc) · 3.13 KB
/
panel-test.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import React from 'react';
import {shallow} from 'enzyme';
import {expect} from 'chai';
import { Panel } from '../src';
describe('<Panel/>', function() {
describe('With default properties', function() {
const component = shallow(<Panel size='auto'/>);
it('Should have a default size of auto', function() {
expect(component.find('div.panel').hasClass('')).to.equal(true);
});
it('Should not have scroll', function() {
expect(component.find('div.panel').hasClass('with-scroll')).to.equal(false);
});
});
it('Panel is extra-small', function() {
const component = shallow(<Panel size='xs'/>);
expect(component.find('div.panel').hasClass('xsmall-panel')).to.equal(true);
});
it('Panel is extra-small', function() {
const component = shallow(<Panel size='extra-small'/>);
expect(component.find('div.panel').hasClass('xsmall-panel')).to.equal(true);
});
it('Panel is small', function() {
const component = shallow(<Panel size='sm'/>);
expect(component.find('div.panel').hasClass('small-panel')).to.equal(true);
});
it('Panel is small', function() {
const component = shallow(<Panel size='small'/>);
expect(component.find('div.panel').hasClass('small-panel')).to.equal(true);
});
it('Panel is medium', function() {
const component = shallow(<Panel size='md'/>);
expect(component.find('div.panel').hasClass('medium-panel')).to.equal(true);
});
it('Panel is medium', function() {
const component = shallow(<Panel size='medium'/>);
expect(component.find('div.panel').hasClass('medium-panel')).to.equal(true);
});
it('Panel is large', function() {
const component = shallow(<Panel size='lg'/>);
expect(component.find('div.panel').hasClass('large-panel')).to.equal(true);
});
it('Panel is large', function() {
const component = shallow(<Panel size='large'/>);
expect(component.find('div.panel').hasClass('large-panel')).to.equal(true);
});
it('Panel is auto sized', function() {
const component = shallow(<Panel size='auto'/>);
expect(component.find('div.panel').hasClass('')).to.equal(true);
});
it('Panel is auto sized', function() {
const component = shallow(<Panel size='none'/>);
expect(component.find('div.panel').hasClass('')).to.equal(true);
});
it('Panel has scroll feature', function() {
const component = shallow(<Panel withScroll={true}/>);
expect(component.find('div.panel').hasClass('with-scroll')).to.equal(true);
});
it('Panel does not have scroll feature', function() {
const component = shallow(<Panel withScroll={false}/>);
expect(component.find('div.panel').hasClass('with-scroll')).to.equal(false);
});
it('Panel has className', function() {
const component = shallow(<Panel className='test'/>);
expect(component.find('div.panel').hasClass('test')).to.equal(true);
});
it('Panel has title', function() {
const component = shallow(<Panel title='title'/>);
expect(component.find('h3').text()).to.contain('title');
});
it('Panel does not have title', function() {
const component = shallow(<Panel title=''/>);
expect(component.find('h3').length).to.equal(0);
});
});