Add a test case for bullet list style component (#27)

This commit is contained in:
Bernardo Smaniotto
2017-10-26 21:01:35 -02:00
committed by Danilo Woznica
parent 25e3842d80
commit 3a33b89782

View File

@@ -0,0 +1,42 @@
import React from 'react'
import { mount, render } from 'enzyme'
import chai, { expect } from 'chai'
import chaiEnzyme from 'chai-enzyme'
import sinon from 'sinon'
chai.use(chaiEnzyme())
import BulletListStyle from '../../src/stylized/BulletListStyle'
describe('<BulletListStyle />:', () => {
it('has a `svg`', () => {
const wrapper = render(<BulletListStyle />)
expect(wrapper.find('svg')).to.have.length(1)
})
it('has a `rect` with `clip-path`', () => {
const wrapper = render(<BulletListStyle />)
expect(wrapper.find('rect[clip-path]')).to.have.length(1)
})
it('has a `linearGradient`', () => {
const wrapper = render(<BulletListStyle />)
expect(wrapper.find('linearGradient')).to.have.length(1)
})
it('has three `stop`', () => {
const wrapper = render(<BulletListStyle />)
expect(wrapper.find('stop')).to.have.length(3)
})
it('has `stop` inside the `linearGradient`', () => {
const wrapper = render(<BulletListStyle />)
expect(wrapper.find('stop').parent().is('lineargradient')).to.equal(true)
})
it('has four `circle`s followed by a `rect`', () => {
const wrapper = render(<BulletListStyle />)
expect(wrapper.find('circle + rect')).to.have.length(4)
})
})