diff options
author | Chocobozzz <me@florianbigard.com> | 2018-04-24 17:05:32 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-24 17:12:57 +0200 |
commit | 48dce1c90dff4e90a4bcffefaecf157336cf904b (patch) | |
tree | 478de23812d0bfd93f47e9ad6ad8888c9edcc235 /server/tests/api/videos/video-channels.ts | |
parent | 82e392f8a42a19815e932dd386e96e61ebe6d191 (diff) | |
download | PeerTube-48dce1c90dff4e90a4bcffefaecf157336cf904b.tar.gz PeerTube-48dce1c90dff4e90a4bcffefaecf157336cf904b.tar.zst PeerTube-48dce1c90dff4e90a4bcffefaecf157336cf904b.zip |
Update video channel routes
Diffstat (limited to 'server/tests/api/videos/video-channels.ts')
-rw-r--r-- | server/tests/api/videos/video-channels.ts | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/server/tests/api/videos/video-channels.ts b/server/tests/api/videos/video-channels.ts index b9c9bbf3c..a7552a83a 100644 --- a/server/tests/api/videos/video-channels.ts +++ b/server/tests/api/videos/video-channels.ts | |||
@@ -17,12 +17,14 @@ import { | |||
17 | setAccessTokensToServers, | 17 | setAccessTokensToServers, |
18 | updateVideoChannel | 18 | updateVideoChannel |
19 | } from '../../utils/index' | 19 | } from '../../utils/index' |
20 | import { getAccountsList } from '../../utils/users/accounts' | ||
20 | 21 | ||
21 | const expect = chai.expect | 22 | const expect = chai.expect |
22 | 23 | ||
23 | describe('Test video channels', function () { | 24 | describe('Test video channels', function () { |
24 | let servers: ServerInfo[] | 25 | let servers: ServerInfo[] |
25 | let userInfo: User | 26 | let userInfo: User |
27 | let accountId: number | ||
26 | let videoChannelId: number | 28 | let videoChannelId: number |
27 | 29 | ||
28 | before(async function () { | 30 | before(async function () { |
@@ -35,6 +37,11 @@ describe('Test video channels', function () { | |||
35 | await setAccessTokensToServers(servers) | 37 | await setAccessTokensToServers(servers) |
36 | await doubleFollow(servers[0], servers[1]) | 38 | await doubleFollow(servers[0], servers[1]) |
37 | 39 | ||
40 | { | ||
41 | const res = await getAccountsList(servers[0].url) | ||
42 | accountId = res.body.data[0].id | ||
43 | } | ||
44 | |||
38 | await wait(5000) | 45 | await wait(5000) |
39 | }) | 46 | }) |
40 | 47 | ||
@@ -54,7 +61,7 @@ describe('Test video channels', function () { | |||
54 | description: 'super video channel description', | 61 | description: 'super video channel description', |
55 | support: 'super video channel support text' | 62 | support: 'super video channel support text' |
56 | } | 63 | } |
57 | const res = await addVideoChannel(servers[0].url, servers[0].accessToken, videoChannel) | 64 | const res = await addVideoChannel(servers[0].url, servers[0].accessToken, accountId, videoChannel) |
58 | videoChannelId = res.body.videoChannel.id | 65 | videoChannelId = res.body.videoChannel.id |
59 | 66 | ||
60 | // The channel is 1 is propagated to servers 2 | 67 | // The channel is 1 is propagated to servers 2 |
@@ -120,7 +127,7 @@ describe('Test video channels', function () { | |||
120 | support: 'video channel support text updated' | 127 | support: 'video channel support text updated' |
121 | } | 128 | } |
122 | 129 | ||
123 | await updateVideoChannel(servers[0].url, servers[0].accessToken, videoChannelId, videoChannelAttributes) | 130 | await updateVideoChannel(servers[0].url, servers[0].accessToken, accountId, videoChannelId, videoChannelAttributes) |
124 | 131 | ||
125 | await wait(3000) | 132 | await wait(3000) |
126 | }) | 133 | }) |
@@ -139,7 +146,7 @@ describe('Test video channels', function () { | |||
139 | }) | 146 | }) |
140 | 147 | ||
141 | it('Should get video channel', async function () { | 148 | it('Should get video channel', async function () { |
142 | const res = await getVideoChannel(servers[0].url, videoChannelId) | 149 | const res = await getVideoChannel(servers[0].url, accountId, videoChannelId) |
143 | 150 | ||
144 | const videoChannel = res.body | 151 | const videoChannel = res.body |
145 | expect(videoChannel.displayName).to.equal('video channel updated') | 152 | expect(videoChannel.displayName).to.equal('video channel updated') |
@@ -148,7 +155,7 @@ describe('Test video channels', function () { | |||
148 | }) | 155 | }) |
149 | 156 | ||
150 | it('Should delete video channel', async function () { | 157 | it('Should delete video channel', async function () { |
151 | await deleteVideoChannel(servers[0].url, servers[0].accessToken, videoChannelId) | 158 | await deleteVideoChannel(servers[0].url, servers[0].accessToken, accountId, videoChannelId) |
152 | }) | 159 | }) |
153 | 160 | ||
154 | it('Should have video channel deleted', async function () { | 161 | it('Should have video channel deleted', async function () { |