From 242f52253e46ce0ffd7349cb06bcd887bb89cf06 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 1 Mar 2022 08:32:49 +0100 Subject: Fix getting avatars in videos list --- server/tests/api/videos/multiple-servers.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'server/tests') diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index 5bbc60559..2a49fd360 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts @@ -2,6 +2,7 @@ import 'mocha' import * as chai from 'chai' +import { and } from 'sequelize/dist' import request from 'supertest' import { checkTmpIsEmpty, @@ -17,6 +18,7 @@ import { cleanupTests, createMultipleServers, doubleFollow, + makeGetRequest, PeerTubeServer, setAccessTokensToServers, setDefaultAccountAvatar, @@ -138,6 +140,22 @@ describe('Test multiple servers', function () { await completeVideoCheck(server, video, checkAttributes) publishedAt = video.publishedAt as string + + expect(video.channel.avatars).to.have.lengthOf(2) + expect(video.account.avatars).to.have.lengthOf(2) + + for (const image of [ ...video.channel.avatars, ...video.account.avatars ]) { + expect(image.createdAt).to.exist + expect(image.updatedAt).to.exist + expect(image.width).to.be.above(20).and.below(1000) + expect(image.path).to.exist + + await makeGetRequest({ + url: server.url, + path: image.path, + expectedStatus: HttpStatusCode.OK_200 + }) + } } }) -- cgit v1.2.3