闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
646 B

  1. import { expect } from 'chai';
  2. import { render } from 'enzyme';
  3. import Avatar from '../../../app/assets/javascripts/components/components/avatar'
  4. describe('<Avatar />', () => {
  5. const src = '/path/to/image.jpg';
  6. const size = 100;
  7. const wrapper = render(<Avatar src={src} animate size={size} />);
  8. it('renders a div element with the given src as background', () => {
  9. expect(wrapper.find('div')).to.have.style('background-image', `url(${src})`);
  10. });
  11. it('renders a div element of the given size', () => {
  12. ['width', 'height'].map((attr) => {
  13. expect(wrapper.find('div')).to.have.style(attr, `${size}px`);
  14. });
  15. });
  16. });