ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix tests
Chocobozzz7b0956ec4f77
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.tsindex da935ef4c9..925367bb9b 100644--- a/client/src/standalone/videos/embed.ts+++ b/client/src/standalone/videos/embed.ts@@ -7,7 +7,7 @@ import 'videojs-dock/dist/videojs-dock.es.js'import { VideoDetails } from '../../../../shared'function getVideoUrl (id: string) {- return window.location.origin + '/api/v1/videos/' + videoId+ return window.location.origin + '/api/v1/videos/' + id}async function loadVideoInfo (videoId: string): Promise<VideoDetails> {diff --git a/server/tests/api/fixtures/avatar-resized.png b/server/tests/api/fixtures/avatar-resized.pngindex e05fc07ce8..9d84151f8e 100644Binary files a/server/tests/api/fixtures/avatar-resized.png and b/server/tests/api/fixtures/avatar-resized.png differdiff --git a/server/tests/api/fixtures/avatar2-resized.png b/server/tests/api/fixtures/avatar2-resized.pngindex a2e2613bfc..44149facbe 100644Binary files a/server/tests/api/fixtures/avatar2-resized.png and b/server/tests/api/fixtures/avatar2-resized.png differdiff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.tsindex 0483b9c3de..3c4eaff149 100644--- a/server/tests/api/users/users-multiple-servers.ts+++ b/server/tests/api/users/users-multiple-servers.ts@@ -65,8 +65,7 @@ describe('Test users with multiple servers', function () {const res = await getMyUserInformation(servers[0].url, servers[0].accessToken)user = res.body- const test = await testImage(servers[0].url, 'avatar2-resized', user.account.avatar.path, '.png')- expect(test).to.equal(true)+ await testImage(servers[0].url, 'avatar2-resized', user.account.avatar.path, '.png')await wait(5000)})@@ -83,8 +82,7 @@ describe('Test users with multiple servers', function () {expect(rootServer1Get.name).to.equal('root')expect(rootServer1Get.host).to.equal('localhost:9001')- const test = await testImage(server.url, 'avatar2-resized', rootServer1Get.avatar.path, '.png')- expect(test).to.equal(true)+ await testImage(server.url, 'avatar2-resized', rootServer1Get.avatar.path, '.png')}})diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.tsindex c23b580898..ac167d4f97 100644--- a/server/tests/api/users/users.ts+++ b/server/tests/api/users/users.ts@@ -359,8 +359,7 @@ describe('Test users', function () {const res = await getMyUserInformation(server.url, accessTokenUser)const user = res.body- const test = await testImage(server.url, 'avatar-resized', user.account.avatar.path, '.png')- expect(test).to.equal(true)+ await testImage(server.url, 'avatar-resized', user.account.avatar.path, '.png')})it('Should be able to update another user', async function () {diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.tsindex 3646fbb0fe..85d158d61a 100644--- a/server/tests/api/videos/multiple-servers.ts+++ b/server/tests/api/videos/multiple-servers.ts@@ -641,8 +641,7 @@ describe('Test multiple servers', function () {const res = await getVideo(server.url, videoUUID)const video = res.body- const test = await testImage(server.url, 'video_short1-preview.webm', video.previewPath)- expect(test).to.equal(true)+ await testImage(server.url, 'video_short1-preview.webm', video.previewPath)}})})diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.tsindex 476a25479e..8f55075fb6 100644--- a/server/tests/api/videos/single-server.ts+++ b/server/tests/api/videos/single-server.ts@@ -341,9 +341,7 @@ describe('Test a single server', function () {for (const video of videos) {const videoName = video.name.replace(' name', '')- const test = await testImage(server.url, videoName, video.thumbnailPath)-- expect(test).to.equal(true)+ await testImage(server.url, videoName, video.thumbnailPath)}})diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.tsindex cf8166a964..f83d950881 100644--- a/server/tests/api/videos/video-comments.ts+++ b/server/tests/api/videos/video-comments.ts@@ -83,8 +83,7 @@ describe('Test video comments', function () {expect(comment.account.name).to.equal('root')expect(comment.account.host).to.equal('localhost:9001')- const test = await testImage(server.url, 'avatar-resized', comment.account.avatar.path, '.png')- expect(test).to.equal(true)+ await testImage(server.url, 'avatar-resized', comment.account.avatar.path, '.png')expect(comment.totalReplies).to.equal(0)expect(dateIsValid(comment.createdAt as string)).to.be.truediff --git a/server/tests/utils/miscs/miscs.ts b/server/tests/utils/miscs/miscs.tsindex 24cbf59ca2..53cb67baf7 100644--- a/server/tests/utils/miscs/miscs.ts+++ b/server/tests/utils/miscs/miscs.ts@@ -1,10 +1,12 @@/* tslint:disable:no-unused-expression */+import * as chai from 'chai'import { isAbsolute, join } from 'path'import * as request from 'supertest'import * as WebTorrent from 'webtorrent'import { readFileBufferPromise } from '../../../helpers/core-utils'+const expect = chai.expectlet webtorrent = new WebTorrent()function immutableAssign <T, U> (target: T, source: U) {@@ -48,7 +50,8 @@ async function testImage (url: string, imageName: string, imagePath: string, extconst minLength = body.length - ((20 * body.length) / 100)const maxLength = body.length + ((20 * body.length) / 100)- return data.length > minLength && data.length < maxLength+ expect(data.length).to.be.above(minLength)+ expect(data.length).to.be.below(maxLength)} else {console.log('Do not test images. Enable it by setting NODE_TEST_IMAGE env variable.')return truediff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.tsindex 8e58f1f0c7..9a4af0b9f9 100644--- a/server/tests/utils/videos/videos.ts+++ b/server/tests/utils/videos/videos.ts@@ -445,13 +445,11 @@ async function completeVideoCheck (expect(file.size).to.be.above(minSize).and.below(maxSize){- const test = await testImage(url, attributes.thumbnailfile || attributes.fixture, videoDetails.thumbnailPath)- expect(test).to.equal(true)+ await testImage(url, attributes.thumbnailfile || attributes.fixture, videoDetails.thumbnailPath)}if (attributes.previewfile) {- const test = await testImage(url, attributes.previewfile, videoDetails.previewPath)- expect(test).to.equal(true)+ await testImage(url, attributes.previewfile, videoDetails.previewPath)}const torrent = await webtorrentAdd(magnetUri, true)