logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

avatar-test.js (932B)


  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. });
  13. const size = 100;
  14. describe('Autoplay', () => {
  15. it('renders a animated avatar', () => {
  16. const component = renderer.create(<Avatar account={account} animate size={size} />);
  17. const tree = component.toJSON();
  18. expect(tree).toMatchSnapshot();
  19. });
  20. });
  21. describe('Still', () => {
  22. it('renders a still avatar', () => {
  23. const component = renderer.create(<Avatar account={account} size={size} />);
  24. const tree = component.toJSON();
  25. expect(tree).toMatchSnapshot();
  26. });
  27. });
  28. // TODO add autoplay test if possible
  29. });