aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli/update-host.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-09 11:21:30 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commita54618880c394ad7571f3f3222dc96ec2dd10d9a (patch)
treec9f7b05e578abc2383bccd707c11438c61857c72 /server/tests/cli/update-host.ts
parent57f879a540551c3b958b0991c8e1e3657a4481d8 (diff)
downloadPeerTube-a54618880c394ad7571f3f3222dc96ec2dd10d9a.tar.gz
PeerTube-a54618880c394ad7571f3f3222dc96ec2dd10d9a.tar.zst
PeerTube-a54618880c394ad7571f3f3222dc96ec2dd10d9a.zip
Introduce channels command
Diffstat (limited to 'server/tests/cli/update-host.ts')
-rw-r--r--server/tests/cli/update-host.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/server/tests/cli/update-host.ts b/server/tests/cli/update-host.ts
index f6131a99f..09a3dd1e7 100644
--- a/server/tests/cli/update-host.ts
+++ b/server/tests/cli/update-host.ts
@@ -2,13 +2,11 @@
2 2
3import 'mocha' 3import 'mocha'
4import { 4import {
5 addVideoChannel,
6 addVideoCommentThread, 5 addVideoCommentThread,
7 cleanupTests, 6 cleanupTests,
8 createUser, 7 createUser,
9 flushAndRunServer, 8 flushAndRunServer,
10 getVideo, 9 getVideo,
11 getVideoChannelsList,
12 getVideosList, 10 getVideosList,
13 killallServers, 11 killallServers,
14 makeActivityPubGetRequest, 12 makeActivityPubGetRequest,
@@ -53,7 +51,7 @@ describe('Test update host scripts', function () {
53 displayName: 'second video channel', 51 displayName: 'second video channel',
54 description: 'super video channel description' 52 description: 'super video channel description'
55 } 53 }
56 await addVideoChannel(server.url, server.accessToken, videoChannel) 54 await server.channelsCommand.create({ attributes: videoChannel })
57 55
58 // Create comments 56 // Create comments
59 const text = 'my super first comment' 57 const text = 'my super first comment'
@@ -91,10 +89,10 @@ describe('Test update host scripts', function () {
91 }) 89 })
92 90
93 it('Should have updated video channels url', async function () { 91 it('Should have updated video channels url', async function () {
94 const res = await getVideoChannelsList(server.url, 0, 5, '-name') 92 const { data, total } = await server.channelsCommand.list({ sort: '-name' })
95 expect(res.body.total).to.equal(3) 93 expect(total).to.equal(3)
96 94
97 for (const channel of res.body.data) { 95 for (const channel of data) {
98 const { body } = await makeActivityPubGetRequest(server.url, '/video-channels/' + channel.name) 96 const { body } = await makeActivityPubGetRequest(server.url, '/video-channels/' + channel.name)
99 97
100 expect(body.id).to.equal('http://localhost:9002/video-channels/' + channel.name) 98 expect(body.id).to.equal('http://localhost:9002/video-channels/' + channel.name)