diff options
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/users/users.ts | 23 | ||||
-rw-r--r-- | server/tests/fixtures/avatar-resized.gif | bin | 0 -> 88318 bytes | |||
-rw-r--r-- | server/tests/fixtures/avatar.gif | bin | 0 -> 46917 bytes |
3 files changed, 20 insertions, 3 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index edb0b4bb3..fe83ca041 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -602,8 +602,8 @@ describe('Test users', function () { | |||
602 | expect(user.account.description).to.be.null | 602 | expect(user.account.description).to.be.null |
603 | }) | 603 | }) |
604 | 604 | ||
605 | it('Should be able to update my avatar', async function () { | 605 | it('Should be able to update my avatar with a gif', async function () { |
606 | const fixture = 'avatar.png' | 606 | const fixture = 'avatar.gif' |
607 | 607 | ||
608 | await updateMyAvatar({ | 608 | await updateMyAvatar({ |
609 | url: server.url, | 609 | url: server.url, |
@@ -614,7 +614,24 @@ describe('Test users', function () { | |||
614 | const res = await getMyUserInformation(server.url, accessTokenUser) | 614 | const res = await getMyUserInformation(server.url, accessTokenUser) |
615 | const user = res.body | 615 | const user = res.body |
616 | 616 | ||
617 | await testImage(server.url, 'avatar-resized', user.account.avatar.path, '.png') | 617 | await testImage(server.url, 'avatar-resized', user.account.avatar.path, '.gif') |
618 | }) | ||
619 | |||
620 | it('Should be able to update my avatar with a gif, and then a png', async function () { | ||
621 | for (const extension of [ '.png', '.gif' ]) { | ||
622 | const fixture = 'avatar' + extension | ||
623 | |||
624 | await updateMyAvatar({ | ||
625 | url: server.url, | ||
626 | accessToken: accessTokenUser, | ||
627 | fixture | ||
628 | }) | ||
629 | |||
630 | const res = await getMyUserInformation(server.url, accessTokenUser) | ||
631 | const user = res.body | ||
632 | |||
633 | await testImage(server.url, 'avatar-resized', user.account.avatar.path, extension) | ||
634 | } | ||
618 | }) | 635 | }) |
619 | 636 | ||
620 | it('Should be able to update my display name', async function () { | 637 | it('Should be able to update my display name', async function () { |
diff --git a/server/tests/fixtures/avatar-resized.gif b/server/tests/fixtures/avatar-resized.gif new file mode 100644 index 000000000..81a82189e --- /dev/null +++ b/server/tests/fixtures/avatar-resized.gif | |||
Binary files differ | |||
diff --git a/server/tests/fixtures/avatar.gif b/server/tests/fixtures/avatar.gif new file mode 100644 index 000000000..f29707760 --- /dev/null +++ b/server/tests/fixtures/avatar.gif | |||
Binary files differ | |||