Files
react-content-loader/tests/Wrap.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

31 lines
929 B
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 ContentLoader from '../src/index'
import Wrap, { generateId } from '../src/Wrap'
describe('<Wrap /> Check id`s to render the SVG', () => {
it('is mask with the same `idClip`', () => {
const wrapper = mount(<Wrap />)
let idClip = wrapper.find('clipPath').prop('id')
expect(wrapper.find('rect[clipPath]').prop('clipPath')).to.have.equal(`url(#${idClip})`)
})
it('is linearGradient with the same `idClip`', () => {
const wrapper = mount(<Wrap />)
let idGradient = wrapper.find('linearGradient').prop('id')
expect(wrapper.find('rect[clipPath]').prop('style').fill).to.have.equal(`url(#${idGradient})`)
})
})