From 53a613171e5d3e2d31c04d85ed883dd9a37cf1fb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 28 May 2018 18:50:44 +0200 Subject: Fix publishedAt value after following a new instance --- server/tests/api/videos/multiple-servers.ts | 3 +++ server/tests/utils/videos/videos.ts | 7 +++++++ 2 files changed, 10 insertions(+) (limited to 'server/tests') diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index 94d627e26..fc7c0cb21 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts @@ -105,6 +105,7 @@ describe('Test multiple servers', function () { await wait(10000) // All servers should have this video + let publishedAt: string = null for (const server of servers) { const isLocal = server.url === 'http://localhost:9001' const checkAttributes = { @@ -120,6 +121,7 @@ describe('Test multiple servers', function () { host: 'localhost:9001' }, isLocal, + publishedAt, duration: 10, tags: [ 'tag1p1', 'tag2p1' ], privacy: VideoPrivacy.PUBLIC, @@ -145,6 +147,7 @@ describe('Test multiple servers', function () { const video = videos[0] await completeVideoCheck(server.url, video, checkAttributes) + publishedAt = video.publishedAt } }) diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts index 46fa5f79d..746b5ca6b 100644 --- a/server/tests/utils/videos/videos.ts +++ b/server/tests/utils/videos/videos.ts @@ -447,6 +447,7 @@ async function completeVideoCheck ( nsfw: boolean commentsEnabled: boolean description: string + publishedAt?: string support: string account: { name: string @@ -500,6 +501,12 @@ async function completeVideoCheck ( expect(dateIsValid(video.publishedAt)).to.be.true expect(dateIsValid(video.updatedAt)).to.be.true + if (attributes.publishedAt) { + console.log(attributes.publishedAt) + console.log(video.publishedAt) + expect(video.publishedAt).to.equal(attributes.publishedAt) + } + const res = await getVideo(url, video.uuid) const videoDetails: VideoDetails = res.body -- cgit v1.2.3