-
Notifications
You must be signed in to change notification settings - Fork 1
/
Sidebar.test.js
45 lines (42 loc) · 1.02 KB
/
Sidebar.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
import React from 'react'
import { mount } from 'enzyme'
import Sidebar from 'lib/layout/Sidebar'
const defaultProps = {
groups: [
{
bgColor: '#e8ccff',
id: '2998',
label: 'Label Dustin"',
rightTitle: 'Wolff',
title: 'Carlotta',
},
{
bgColor: '#e8ccff',
id: '2999',
label: 'Label Myrtle"',
rightTitle: '"Sauer"',
title: 'Elmer',
}
],
width: 10,
height: 10,
groupHeights: [30, 27],
keys: {
groupIdKey: 'id',
groupRightTitleKey: 'rightTitle',
groupTitleKey: 'title',
itemDivTitleKey: 'title',
itemGroupKey: 'group',
itemIdKey: 'id',
itemTimeEndKey: 'end',
itemTimeStartKey: 'start',
itemTitleKey: 'title'
}
}
describe('GroupRows', () => {
it('passes props and get right height for first group', () => {
const wrapper = mount(<Sidebar {...defaultProps} />);
const component = wrapper.find('div.rct-sidebar-row').first();
expect(component.prop('style').height).toBe('30px');
})
})