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.

37 lines
947 B

  1. import React from 'react';
  2. import renderer from 'react-test-renderer';
  3. import { fromJS } from 'immutable';
  4. import Avatar from '../avatar';
  5. describe('<Avatar />', () => {
  6. const account = fromJS({
  7. username: 'alice',
  8. acct: 'alice',
  9. display_name: 'Alice',
  10. avatar: '/animated/alice.gif',
  11. avatar_static: '/static/alice.jpg',
  12. bot: true,
  13. });
  14. const size = 100;
  15. describe('Autoplay', () => {
  16. it('renders a animated avatar', () => {
  17. const component = renderer.create(<Avatar account={account} animate size={size} />);
  18. const tree = component.toJSON();
  19. expect(tree).toMatchSnapshot();
  20. });
  21. });
  22. describe('Still', () => {
  23. it('renders a still avatar', () => {
  24. const component = renderer.create(<Avatar account={account} size={size} />);
  25. const tree = component.toJSON();
  26. expect(tree).toMatchSnapshot();
  27. });
  28. });
  29. // TODO add autoplay test if possible
  30. });