Guest User

Untitled

a guest
Jan 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import React from 'react'
  2. import { mount } from 'enzyme'
  3. import faker from 'faker'
  4. import 'jest-styled-components'
  5. import { MapPreviewImage } from './MapPreviewImage'
  6.  
  7. describe('Today I want to test styled-components', () => {
  8. it('have MapPreviewImage styledcomponent', () => {
  9. const src = faker.image.avatar()
  10. const ratio = 1.55
  11. const styledProps = { ratio, src }
  12.  
  13. const wrapper = mount(<MapPreviewImage {...styledProps} />)
  14. expect(wrapper).toHaveStyleRule('background-image', `url(${src})`)
  15. expect(wrapper).toHaveStyleRule('padding-top', `${100 / ratio}%`)
  16. })
  17. })
Add Comment
Please, Sign In to add comment