When avatar/header are GIF, generate static versions (#1428)
* When avatar/header are GIF, generate static versions. Account API returns "avatar"/"avatar_static", "header"/"header_static" Static version is the same as original for other cases Web UI de-animates avatars in toots, lists of users Fix #441, fix #596, prerequisite for #1064 * Fix JS test * Add rake task to generate static avatars/headers from GIF ones, add test
This commit is contained in:
parent
b57eed4584
commit
12f72e1740
15 changed files with 108 additions and 138 deletions
|
@ -6,16 +6,10 @@ import Avatar from '../../../app/assets/javascripts/components/components/avatar
|
|||
describe('<Avatar />', () => {
|
||||
const src = '/path/to/image.jpg';
|
||||
const size = 100;
|
||||
const wrapper = render(<Avatar src={src} size={size} />);
|
||||
const wrapper = render(<Avatar src={src} animate size={size} />);
|
||||
|
||||
it('renders an img element with the given src', () => {
|
||||
expect(wrapper.find('img')).to.have.attr('src', `${src}`);
|
||||
});
|
||||
|
||||
it('renders an img element of the given size', () => {
|
||||
['width', 'height'].map((attr) => {
|
||||
expect(wrapper.find('img')).to.have.attr(attr, `${size}`);
|
||||
});
|
||||
it('renders a div element with the given src as background', () => {
|
||||
expect(wrapper.find('div')).to.have.style('background-image', `url(${src})`);
|
||||
});
|
||||
|
||||
it('renders a div element of the given size', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue