diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-26 08:50:52 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-05-15 15:14:21 +0200 |
commit | 48f07b4a4091cb10dc4d179118e155f3a118dca8 (patch) | |
tree | 8fcc6bd8cafa636ebaf97a083fafbcc0d52ad5cd /server/tests/api/videos/single-server.ts | |
parent | 7243f84db0f34c6d5610a54603b0cce7c284a7b3 (diff) | |
download | PeerTube-48f07b4a4091cb10dc4d179118e155f3a118dca8.tar.gz PeerTube-48f07b4a4091cb10dc4d179118e155f3a118dca8.tar.zst PeerTube-48f07b4a4091cb10dc4d179118e155f3a118dca8.zip |
All API tests in parallel
Diffstat (limited to 'server/tests/api/videos/single-server.ts')
-rw-r--r-- | server/tests/api/videos/single-server.ts | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/server/tests/api/videos/single-server.ts b/server/tests/api/videos/single-server.ts index b0412f4df..d8f394ac7 100644 --- a/server/tests/api/videos/single-server.ts +++ b/server/tests/api/videos/single-server.ts | |||
@@ -37,7 +37,7 @@ describe('Test a single server', function () { | |||
37 | let videoUUID = '' | 37 | let videoUUID = '' |
38 | let videosListBase: any[] = null | 38 | let videosListBase: any[] = null |
39 | 39 | ||
40 | const getCheckAttributes = { | 40 | const getCheckAttributes = () => ({ |
41 | name: 'my super name', | 41 | name: 'my super name', |
42 | category: 2, | 42 | category: 2, |
43 | licence: 6, | 43 | licence: 6, |
@@ -68,9 +68,9 @@ describe('Test a single server', function () { | |||
68 | size: 218910 | 68 | size: 218910 |
69 | } | 69 | } |
70 | ] | 70 | ] |
71 | } | 71 | }) |
72 | 72 | ||
73 | const updateCheckAttributes = { | 73 | const updateCheckAttributes = () => ({ |
74 | name: 'my super video updated', | 74 | name: 'my super video updated', |
75 | category: 4, | 75 | category: 4, |
76 | licence: 2, | 76 | licence: 2, |
@@ -101,7 +101,7 @@ describe('Test a single server', function () { | |||
101 | size: 292677 | 101 | size: 292677 |
102 | } | 102 | } |
103 | ] | 103 | ] |
104 | } | 104 | }) |
105 | 105 | ||
106 | before(async function () { | 106 | before(async function () { |
107 | this.timeout(30000) | 107 | this.timeout(30000) |
@@ -182,7 +182,7 @@ describe('Test a single server', function () { | |||
182 | expect(res.body.data.length).to.equal(1) | 182 | expect(res.body.data.length).to.equal(1) |
183 | 183 | ||
184 | const video = res.body.data[0] | 184 | const video = res.body.data[0] |
185 | await completeVideoCheck(server.url, video, getCheckAttributes) | 185 | await completeVideoCheck(server.url, video, getCheckAttributes()) |
186 | }) | 186 | }) |
187 | 187 | ||
188 | it('Should get the video by UUID', async function () { | 188 | it('Should get the video by UUID', async function () { |
@@ -191,7 +191,7 @@ describe('Test a single server', function () { | |||
191 | const res = await getVideo(server.url, videoUUID) | 191 | const res = await getVideo(server.url, videoUUID) |
192 | 192 | ||
193 | const video = res.body | 193 | const video = res.body |
194 | await completeVideoCheck(server.url, video, getCheckAttributes) | 194 | await completeVideoCheck(server.url, video, getCheckAttributes()) |
195 | }) | 195 | }) |
196 | 196 | ||
197 | it('Should have the views updated', async function () { | 197 | it('Should have the views updated', async function () { |
@@ -376,7 +376,7 @@ describe('Test a single server', function () { | |||
376 | const res = await getVideo(server.url, videoId) | 376 | const res = await getVideo(server.url, videoId) |
377 | const video = res.body | 377 | const video = res.body |
378 | 378 | ||
379 | await completeVideoCheck(server.url, video, updateCheckAttributes) | 379 | await completeVideoCheck(server.url, video, updateCheckAttributes()) |
380 | }) | 380 | }) |
381 | 381 | ||
382 | it('Should update only the tags of a video', async function () { | 382 | it('Should update only the tags of a video', async function () { |
@@ -388,7 +388,7 @@ describe('Test a single server', function () { | |||
388 | const res = await getVideo(server.url, videoId) | 388 | const res = await getVideo(server.url, videoId) |
389 | const video = res.body | 389 | const video = res.body |
390 | 390 | ||
391 | await completeVideoCheck(server.url, video, Object.assign(updateCheckAttributes, attributes)) | 391 | await completeVideoCheck(server.url, video, Object.assign(updateCheckAttributes(), attributes)) |
392 | }) | 392 | }) |
393 | 393 | ||
394 | it('Should update only the description of a video', async function () { | 394 | it('Should update only the description of a video', async function () { |
@@ -400,7 +400,8 @@ describe('Test a single server', function () { | |||
400 | const res = await getVideo(server.url, videoId) | 400 | const res = await getVideo(server.url, videoId) |
401 | const video = res.body | 401 | const video = res.body |
402 | 402 | ||
403 | await completeVideoCheck(server.url, video, Object.assign(updateCheckAttributes, attributes)) | 403 | const expectedAttributes = Object.assign(updateCheckAttributes(), { tags: [ 'supertag', 'tag1', 'tag2' ] }, attributes) |
404 | await completeVideoCheck(server.url, video, expectedAttributes) | ||
404 | }) | 405 | }) |
405 | 406 | ||
406 | it('Should like a video', async function () { | 407 | it('Should like a video', async function () { |