diff options
Diffstat (limited to 'server/tests/api/search/search-activitypub-video-channels.ts')
-rw-r--r-- | server/tests/api/search/search-activitypub-video-channels.ts | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/server/tests/api/search/search-activitypub-video-channels.ts b/server/tests/api/search/search-activitypub-video-channels.ts index 75794402d..71e9367e5 100644 --- a/server/tests/api/search/search-activitypub-video-channels.ts +++ b/server/tests/api/search/search-activitypub-video-channels.ts | |||
@@ -30,34 +30,34 @@ describe('Test ActivityPub video channels search', function () { | |||
30 | await setAccessTokensToServers(servers) | 30 | await setAccessTokensToServers(servers) |
31 | 31 | ||
32 | { | 32 | { |
33 | await servers[0].usersCommand.create({ username: 'user1_server1', password: 'password' }) | 33 | await servers[0].users.create({ username: 'user1_server1', password: 'password' }) |
34 | const channel = { | 34 | const channel = { |
35 | name: 'channel1_server1', | 35 | name: 'channel1_server1', |
36 | displayName: 'Channel 1 server 1' | 36 | displayName: 'Channel 1 server 1' |
37 | } | 37 | } |
38 | await servers[0].channelsCommand.create({ attributes: channel }) | 38 | await servers[0].channels.create({ attributes: channel }) |
39 | } | 39 | } |
40 | 40 | ||
41 | { | 41 | { |
42 | const user = { username: 'user1_server2', password: 'password' } | 42 | const user = { username: 'user1_server2', password: 'password' } |
43 | await servers[1].usersCommand.create({ username: user.username, password: user.password }) | 43 | await servers[1].users.create({ username: user.username, password: user.password }) |
44 | userServer2Token = await servers[1].loginCommand.getAccessToken(user) | 44 | userServer2Token = await servers[1].login.getAccessToken(user) |
45 | 45 | ||
46 | const channel = { | 46 | const channel = { |
47 | name: 'channel1_server2', | 47 | name: 'channel1_server2', |
48 | displayName: 'Channel 1 server 2' | 48 | displayName: 'Channel 1 server 2' |
49 | } | 49 | } |
50 | const created = await servers[1].channelsCommand.create({ token: userServer2Token, attributes: channel }) | 50 | const created = await servers[1].channels.create({ token: userServer2Token, attributes: channel }) |
51 | channelIdServer2 = created.id | 51 | channelIdServer2 = created.id |
52 | 52 | ||
53 | const attributes = { name: 'video 1 server 2', channelId: channelIdServer2 } | 53 | const attributes = { name: 'video 1 server 2', channelId: channelIdServer2 } |
54 | const { uuid } = await servers[1].videosCommand.upload({ token: userServer2Token, attributes }) | 54 | const { uuid } = await servers[1].videos.upload({ token: userServer2Token, attributes }) |
55 | videoServer2UUID = uuid | 55 | videoServer2UUID = uuid |
56 | } | 56 | } |
57 | 57 | ||
58 | await waitJobs(servers) | 58 | await waitJobs(servers) |
59 | 59 | ||
60 | command = servers[0].searchCommand | 60 | command = servers[0].search |
61 | }) | 61 | }) |
62 | 62 | ||
63 | it('Should not find a remote video channel', async function () { | 63 | it('Should not find a remote video channel', async function () { |
@@ -134,7 +134,7 @@ describe('Test ActivityPub video channels search', function () { | |||
134 | }) | 134 | }) |
135 | 135 | ||
136 | it('Should not list this remote video channel', async function () { | 136 | it('Should not list this remote video channel', async function () { |
137 | const body = await servers[0].channelsCommand.list() | 137 | const body = await servers[0].channels.list() |
138 | expect(body.total).to.equal(3) | 138 | expect(body.total).to.equal(3) |
139 | expect(body.data).to.have.lengthOf(3) | 139 | expect(body.data).to.have.lengthOf(3) |
140 | expect(body.data[0].name).to.equal('channel1_server1') | 140 | expect(body.data[0].name).to.equal('channel1_server1') |
@@ -147,7 +147,7 @@ describe('Test ActivityPub video channels search', function () { | |||
147 | 147 | ||
148 | await waitJobs(servers) | 148 | await waitJobs(servers) |
149 | 149 | ||
150 | const { total, data } = await servers[0].videosCommand.listByChannel({ | 150 | const { total, data } = await servers[0].videos.listByChannel({ |
151 | token: null, | 151 | token: null, |
152 | videoChannelName: 'channel1_server2@localhost:' + servers[1].port | 152 | videoChannelName: 'channel1_server2@localhost:' + servers[1].port |
153 | }) | 153 | }) |
@@ -156,7 +156,7 @@ describe('Test ActivityPub video channels search', function () { | |||
156 | }) | 156 | }) |
157 | 157 | ||
158 | it('Should list video channel videos of server 2 with token', async function () { | 158 | it('Should list video channel videos of server 2 with token', async function () { |
159 | const { total, data } = await servers[0].videosCommand.listByChannel({ | 159 | const { total, data } = await servers[0].videos.listByChannel({ |
160 | videoChannelName: 'channel1_server2@localhost:' + servers[1].port | 160 | videoChannelName: 'channel1_server2@localhost:' + servers[1].port |
161 | }) | 161 | }) |
162 | 162 | ||
@@ -167,12 +167,12 @@ describe('Test ActivityPub video channels search', function () { | |||
167 | it('Should update video channel of server 2, and refresh it on server 1', async function () { | 167 | it('Should update video channel of server 2, and refresh it on server 1', async function () { |
168 | this.timeout(60000) | 168 | this.timeout(60000) |
169 | 169 | ||
170 | await servers[1].channelsCommand.update({ | 170 | await servers[1].channels.update({ |
171 | token: userServer2Token, | 171 | token: userServer2Token, |
172 | channelName: 'channel1_server2', | 172 | channelName: 'channel1_server2', |
173 | attributes: { displayName: 'channel updated' } | 173 | attributes: { displayName: 'channel updated' } |
174 | }) | 174 | }) |
175 | await servers[1].usersCommand.updateMe({ token: userServer2Token, displayName: 'user updated' }) | 175 | await servers[1].users.updateMe({ token: userServer2Token, displayName: 'user updated' }) |
176 | 176 | ||
177 | await waitJobs(servers) | 177 | await waitJobs(servers) |
178 | // Expire video channel | 178 | // Expire video channel |
@@ -193,8 +193,8 @@ describe('Test ActivityPub video channels search', function () { | |||
193 | it('Should update and add a video on server 2, and update it on server 1 after a search', async function () { | 193 | it('Should update and add a video on server 2, and update it on server 1 after a search', async function () { |
194 | this.timeout(60000) | 194 | this.timeout(60000) |
195 | 195 | ||
196 | await servers[1].videosCommand.update({ token: userServer2Token, id: videoServer2UUID, attributes: { name: 'video 1 updated' } }) | 196 | await servers[1].videos.update({ token: userServer2Token, id: videoServer2UUID, attributes: { name: 'video 1 updated' } }) |
197 | await servers[1].videosCommand.upload({ token: userServer2Token, attributes: { name: 'video 2 server 2', channelId: channelIdServer2 } }) | 197 | await servers[1].videos.upload({ token: userServer2Token, attributes: { name: 'video 2 server 2', channelId: channelIdServer2 } }) |
198 | 198 | ||
199 | await waitJobs(servers) | 199 | await waitJobs(servers) |
200 | 200 | ||
@@ -207,7 +207,7 @@ describe('Test ActivityPub video channels search', function () { | |||
207 | await waitJobs(servers) | 207 | await waitJobs(servers) |
208 | 208 | ||
209 | const videoChannelName = 'channel1_server2@localhost:' + servers[1].port | 209 | const videoChannelName = 'channel1_server2@localhost:' + servers[1].port |
210 | const { total, data } = await servers[0].videosCommand.listByChannel({ videoChannelName, sort: '-createdAt' }) | 210 | const { total, data } = await servers[0].videos.listByChannel({ videoChannelName, sort: '-createdAt' }) |
211 | 211 | ||
212 | expect(total).to.equal(2) | 212 | expect(total).to.equal(2) |
213 | expect(data[0].name).to.equal('video 2 server 2') | 213 | expect(data[0].name).to.equal('video 2 server 2') |
@@ -217,7 +217,7 @@ describe('Test ActivityPub video channels search', function () { | |||
217 | it('Should delete video channel of server 2, and delete it on server 1', async function () { | 217 | it('Should delete video channel of server 2, and delete it on server 1', async function () { |
218 | this.timeout(60000) | 218 | this.timeout(60000) |
219 | 219 | ||
220 | await servers[1].channelsCommand.delete({ token: userServer2Token, channelName: 'channel1_server2' }) | 220 | await servers[1].channels.delete({ token: userServer2Token, channelName: 'channel1_server2' }) |
221 | 221 | ||
222 | await waitJobs(servers) | 222 | await waitJobs(servers) |
223 | // Expire video | 223 | // Expire video |