Files
react-content-loader/tests/stylized/CodeStyle.js
Danilo Woznica 6093892d58 Refactor and React 16 compatibility (#34)
* Refactor tests, update react

* Refactor

* Refactor

* Change script

* Update npmignore

* Remove unecessary code
2017-12-03 20:29:11 -03:00

41 lines
1.1 KiB
JavaScript

import React from 'react'
import Enzyme, { mount } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import chai, { expect } from 'chai'
import chaiEnzyme from 'chai-enzyme'
import sinon from 'sinon'
Enzyme.configure({ adapter: new Adapter() })
chai.use(chaiEnzyme())
import CodeStyle from '../../src/stylized/CodeStyle'
describe('<CodeStyle />:', () => {
it('has a `svg`', () => {
const wrapper = mount(<CodeStyle />)
expect(wrapper.find('svg')).to.have.length(1)
})
it('has a `rect` with `clipPath`', () => {
const wrapper = mount(<CodeStyle />)
expect(wrapper.find('rect[clipPath]')).to.have.length(1)
})
it('has a `linearGradient`', () => {
const wrapper = mount(<CodeStyle />)
expect(wrapper.find('linearGradient')).to.have.length(1)
})
it('has three `stop`', () => {
const wrapper = mount(<CodeStyle />)
expect(wrapper.find('stop')).to.have.length(3)
})
it('has `stop` inside the `linearGradient`', () => {
const wrapper = mount(<CodeStyle />)
expect(wrapper.find('linearGradient').find('stop')).to.have.length(3)
})
})