mirror of
https://github.com/zhigang1992/react-content-loader.git
synced 2026-04-03 22:48:20 +08:00
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import React from 'react'
|
|
|
|
import {shallow, mount, render} from 'enzyme'
|
|
import chai, {expect} from 'chai'
|
|
import chaiEnzyme from 'chai-enzyme'
|
|
import sinon from 'sinon'
|
|
|
|
chai.use(chaiEnzyme())
|
|
|
|
import CodeStyle from '../../src/stylized/CodeStyle'
|
|
|
|
describe('<CodeStyle />:', () => {
|
|
it('has a `svg`', () => {
|
|
const wrapper = render(<CodeStyle />)
|
|
expect(wrapper.find('svg')).to.have.length(1)
|
|
})
|
|
|
|
it('has a `rect` with `clip-path`', () => {
|
|
const wrapper = render(<CodeStyle />)
|
|
expect(wrapper.find('rect[clip-path]')).to.have.length(1)
|
|
})
|
|
|
|
it('has a `linearGradient`', () => {
|
|
const wrapper = render(<CodeStyle />)
|
|
expect(wrapper.find('linearGradient')).to.have.length(1)
|
|
})
|
|
|
|
it('has three `stop`', () => {
|
|
const wrapper = render(<CodeStyle />)
|
|
expect(wrapper.find('stop')).to.have.length(3)
|
|
})
|
|
|
|
it('has `stop` inside the `linearGradient`', () => {
|
|
const wrapper = render(<CodeStyle />)
|
|
expect(wrapper.find('stop').parent().is('lineargradient')).to.equal(true)
|
|
})
|
|
})
|