forked from badges/shields
-
Notifications
You must be signed in to change notification settings - Fork 1
/
category-headings.spec.js
33 lines (27 loc) · 1 KB
/
category-headings.spec.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
import React from 'react'
import { shallow } from 'enzyme'
import { expect } from 'chai'
import { H3 } from './common'
import { CategoryHeading, CategoryHeadings } from './category-headings'
import '../enzyme-conf.spec'
const exampleCategories = [{ id: 'cat', name: 'Example category' }]
describe('<CategoryHeading />', function() {
it('renders', function() {
shallow(<CategoryHeading category={exampleCategories[0]} />)
})
it('contains the expected heading', function() {
const wrapper = shallow(<CategoryHeading category={exampleCategories[0]} />)
expect(wrapper).to.contain(<H3 id="cat">Example category</H3>)
})
})
describe('<CategoryHeadings />', function() {
it('renders', function() {
shallow(<CategoryHeadings categories={exampleCategories} />)
})
it('contains the expected child', function() {
const wrapper = shallow(<CategoryHeadings categories={exampleCategories} />)
expect(wrapper).to.contain(
<CategoryHeading category={exampleCategories[0]} />
)
})
})