aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/cli/update-host.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:04:35 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit89d241a79c262b9775c233b73cff080043ebb5e6 (patch)
treecb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tests/cli/update-host.ts
parentd23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff)
downloadPeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip
Shorter server command names
Diffstat (limited to 'server/tests/cli/update-host.ts')
-rw-r--r--server/tests/cli/update-host.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/server/tests/cli/update-host.ts b/server/tests/cli/update-host.ts
index d90b4a64d..d2d196456 100644
--- a/server/tests/cli/update-host.ts
+++ b/server/tests/cli/update-host.ts
@@ -30,11 +30,11 @@ describe('Test update host scripts', function () {
30 await setAccessTokensToServers([ server ]) 30 await setAccessTokensToServers([ server ])
31 31
32 // Upload two videos for our needs 32 // Upload two videos for our needs
33 const { uuid: video1UUID } = await server.videosCommand.upload() 33 const { uuid: video1UUID } = await server.videos.upload()
34 await server.videosCommand.upload() 34 await server.videos.upload()
35 35
36 // Create a user 36 // Create a user
37 await server.usersCommand.create({ username: 'toto', password: 'coucou' }) 37 await server.users.create({ username: 'toto', password: 'coucou' })
38 38
39 // Create channel 39 // Create channel
40 const videoChannel = { 40 const videoChannel = {
@@ -42,11 +42,11 @@ describe('Test update host scripts', function () {
42 displayName: 'second video channel', 42 displayName: 'second video channel',
43 description: 'super video channel description' 43 description: 'super video channel description'
44 } 44 }
45 await server.channelsCommand.create({ attributes: videoChannel }) 45 await server.channels.create({ attributes: videoChannel })
46 46
47 // Create comments 47 // Create comments
48 const text = 'my super first comment' 48 const text = 'my super first comment'
49 await server.commentsCommand.createThread({ videoId: video1UUID, text }) 49 await server.comments.createThread({ videoId: video1UUID, text })
50 50
51 await waitJobs(server) 51 await waitJobs(server)
52 }) 52 })
@@ -58,11 +58,11 @@ describe('Test update host scripts', function () {
58 // Run server with standard configuration 58 // Run server with standard configuration
59 await reRunServer(server) 59 await reRunServer(server)
60 60
61 await server.cliCommand.execWithEnv(`npm run update-host`) 61 await server.cli.execWithEnv(`npm run update-host`)
62 }) 62 })
63 63
64 it('Should have updated videos url', async function () { 64 it('Should have updated videos url', async function () {
65 const { total, data } = await server.videosCommand.list() 65 const { total, data } = await server.videos.list()
66 expect(total).to.equal(2) 66 expect(total).to.equal(2)
67 67
68 for (const video of data) { 68 for (const video of data) {
@@ -70,7 +70,7 @@ describe('Test update host scripts', function () {
70 70
71 expect(body.id).to.equal('http://localhost:9002/videos/watch/' + video.uuid) 71 expect(body.id).to.equal('http://localhost:9002/videos/watch/' + video.uuid)
72 72
73 const videoDetails = await server.videosCommand.get({ id: video.uuid }) 73 const videoDetails = await server.videos.get({ id: video.uuid })
74 74
75 expect(videoDetails.trackerUrls[0]).to.include(server.host) 75 expect(videoDetails.trackerUrls[0]).to.include(server.host)
76 expect(videoDetails.streamingPlaylists[0].playlistUrl).to.include(server.host) 76 expect(videoDetails.streamingPlaylists[0].playlistUrl).to.include(server.host)
@@ -79,7 +79,7 @@ describe('Test update host scripts', function () {
79 }) 79 })
80 80
81 it('Should have updated video channels url', async function () { 81 it('Should have updated video channels url', async function () {
82 const { data, total } = await server.channelsCommand.list({ sort: '-name' }) 82 const { data, total } = await server.channels.list({ sort: '-name' })
83 expect(total).to.equal(3) 83 expect(total).to.equal(3)
84 84
85 for (const channel of data) { 85 for (const channel of data) {
@@ -90,7 +90,7 @@ describe('Test update host scripts', function () {
90 }) 90 })
91 91
92 it('Should have updated accounts url', async function () { 92 it('Should have updated accounts url', async function () {
93 const body = await server.accountsCommand.list() 93 const body = await server.accounts.list()
94 expect(body.total).to.equal(3) 94 expect(body.total).to.equal(3)
95 95
96 for (const account of body.data) { 96 for (const account of body.data) {
@@ -104,11 +104,11 @@ describe('Test update host scripts', function () {
104 it('Should have updated torrent hosts', async function () { 104 it('Should have updated torrent hosts', async function () {
105 this.timeout(30000) 105 this.timeout(30000)
106 106
107 const { data } = await server.videosCommand.list() 107 const { data } = await server.videos.list()
108 expect(data).to.have.lengthOf(2) 108 expect(data).to.have.lengthOf(2)
109 109
110 for (const video of data) { 110 for (const video of data) {
111 const videoDetails = await server.videosCommand.get({ id: video.id }) 111 const videoDetails = await server.videos.get({ id: video.id })
112 112
113 expect(videoDetails.files).to.have.lengthOf(4) 113 expect(videoDetails.files).to.have.lengthOf(4)
114 114