diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 09:04:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 89d241a79c262b9775c233b73cff080043ebb5e6 (patch) | |
tree | cb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tests/api/search | |
parent | d23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff) | |
download | PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip |
Shorter server command names
Diffstat (limited to 'server/tests/api/search')
-rw-r--r-- | server/tests/api/search/search-activitypub-video-channels.ts | 32 | ||||
-rw-r--r-- | server/tests/api/search/search-activitypub-video-playlists.ts | 28 | ||||
-rw-r--r-- | server/tests/api/search/search-activitypub-videos.ts | 14 | ||||
-rw-r--r-- | server/tests/api/search/search-channels.ts | 6 | ||||
-rw-r--r-- | server/tests/api/search/search-index.ts | 14 | ||||
-rw-r--r-- | server/tests/api/search/search-playlists.ts | 20 | ||||
-rw-r--r-- | server/tests/api/search/search-videos.ts | 46 |
7 files changed, 80 insertions, 80 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 |
diff --git a/server/tests/api/search/search-activitypub-video-playlists.ts b/server/tests/api/search/search-activitypub-video-playlists.ts index 46105c12c..7c99b954b 100644 --- a/server/tests/api/search/search-activitypub-video-playlists.ts +++ b/server/tests/api/search/search-activitypub-video-playlists.ts | |||
@@ -33,40 +33,40 @@ describe('Test ActivityPub playlists search', function () { | |||
33 | await setDefaultVideoChannel(servers) | 33 | await setDefaultVideoChannel(servers) |
34 | 34 | ||
35 | { | 35 | { |
36 | const video1 = (await servers[0].videosCommand.quickUpload({ name: 'video 1' })).uuid | 36 | const video1 = (await servers[0].videos.quickUpload({ name: 'video 1' })).uuid |
37 | const video2 = (await servers[0].videosCommand.quickUpload({ name: 'video 2' })).uuid | 37 | const video2 = (await servers[0].videos.quickUpload({ name: 'video 2' })).uuid |
38 | 38 | ||
39 | const attributes = { | 39 | const attributes = { |
40 | displayName: 'playlist 1 on server 1', | 40 | displayName: 'playlist 1 on server 1', |
41 | privacy: VideoPlaylistPrivacy.PUBLIC, | 41 | privacy: VideoPlaylistPrivacy.PUBLIC, |
42 | videoChannelId: servers[0].videoChannel.id | 42 | videoChannelId: servers[0].store.channel.id |
43 | } | 43 | } |
44 | const created = await servers[0].playlistsCommand.create({ attributes }) | 44 | const created = await servers[0].playlists.create({ attributes }) |
45 | playlistServer1UUID = created.uuid | 45 | playlistServer1UUID = created.uuid |
46 | 46 | ||
47 | for (const videoId of [ video1, video2 ]) { | 47 | for (const videoId of [ video1, video2 ]) { |
48 | await servers[0].playlistsCommand.addElement({ playlistId: playlistServer1UUID, attributes: { videoId } }) | 48 | await servers[0].playlists.addElement({ playlistId: playlistServer1UUID, attributes: { videoId } }) |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | { | 52 | { |
53 | const videoId = (await servers[1].videosCommand.quickUpload({ name: 'video 1' })).uuid | 53 | const videoId = (await servers[1].videos.quickUpload({ name: 'video 1' })).uuid |
54 | video2Server2 = (await servers[1].videosCommand.quickUpload({ name: 'video 2' })).uuid | 54 | video2Server2 = (await servers[1].videos.quickUpload({ name: 'video 2' })).uuid |
55 | 55 | ||
56 | const attributes = { | 56 | const attributes = { |
57 | displayName: 'playlist 1 on server 2', | 57 | displayName: 'playlist 1 on server 2', |
58 | privacy: VideoPlaylistPrivacy.PUBLIC, | 58 | privacy: VideoPlaylistPrivacy.PUBLIC, |
59 | videoChannelId: servers[1].videoChannel.id | 59 | videoChannelId: servers[1].store.channel.id |
60 | } | 60 | } |
61 | const created = await servers[1].playlistsCommand.create({ attributes }) | 61 | const created = await servers[1].playlists.create({ attributes }) |
62 | playlistServer2UUID = created.uuid | 62 | playlistServer2UUID = created.uuid |
63 | 63 | ||
64 | await servers[1].playlistsCommand.addElement({ playlistId: playlistServer2UUID, attributes: { videoId } }) | 64 | await servers[1].playlists.addElement({ playlistId: playlistServer2UUID, attributes: { videoId } }) |
65 | } | 65 | } |
66 | 66 | ||
67 | await waitJobs(servers) | 67 | await waitJobs(servers) |
68 | 68 | ||
69 | command = servers[0].searchCommand | 69 | command = servers[0].search |
70 | }) | 70 | }) |
71 | 71 | ||
72 | it('Should not find a remote playlist', async function () { | 72 | it('Should not find a remote playlist', async function () { |
@@ -139,7 +139,7 @@ describe('Test ActivityPub playlists search', function () { | |||
139 | }) | 139 | }) |
140 | 140 | ||
141 | it('Should not list this remote playlist', async function () { | 141 | it('Should not list this remote playlist', async function () { |
142 | const body = await servers[0].playlistsCommand.list({ start: 0, count: 10 }) | 142 | const body = await servers[0].playlists.list({ start: 0, count: 10 }) |
143 | expect(body.total).to.equal(1) | 143 | expect(body.total).to.equal(1) |
144 | expect(body.data).to.have.lengthOf(1) | 144 | expect(body.data).to.have.lengthOf(1) |
145 | expect(body.data[0].displayName).to.equal('playlist 1 on server 1') | 145 | expect(body.data[0].displayName).to.equal('playlist 1 on server 1') |
@@ -148,7 +148,7 @@ describe('Test ActivityPub playlists search', function () { | |||
148 | it('Should update the playlist of server 2, and refresh it on server 1', async function () { | 148 | it('Should update the playlist of server 2, and refresh it on server 1', async function () { |
149 | this.timeout(60000) | 149 | this.timeout(60000) |
150 | 150 | ||
151 | await servers[1].playlistsCommand.addElement({ playlistId: playlistServer2UUID, attributes: { videoId: video2Server2 } }) | 151 | await servers[1].playlists.addElement({ playlistId: playlistServer2UUID, attributes: { videoId: video2Server2 } }) |
152 | 152 | ||
153 | await waitJobs(servers) | 153 | await waitJobs(servers) |
154 | // Expire playlist | 154 | // Expire playlist |
@@ -172,7 +172,7 @@ describe('Test ActivityPub playlists search', function () { | |||
172 | it('Should delete playlist of server 2, and delete it on server 1', async function () { | 172 | it('Should delete playlist of server 2, and delete it on server 1', async function () { |
173 | this.timeout(60000) | 173 | this.timeout(60000) |
174 | 174 | ||
175 | await servers[1].playlistsCommand.delete({ playlistId: playlistServer2UUID }) | 175 | await servers[1].playlists.delete({ playlistId: playlistServer2UUID }) |
176 | 176 | ||
177 | await waitJobs(servers) | 177 | await waitJobs(servers) |
178 | // Expiration | 178 | // Expiration |
diff --git a/server/tests/api/search/search-activitypub-videos.ts b/server/tests/api/search/search-activitypub-videos.ts index 19b4d5ed8..0dfc63446 100644 --- a/server/tests/api/search/search-activitypub-videos.ts +++ b/server/tests/api/search/search-activitypub-videos.ts | |||
@@ -30,18 +30,18 @@ describe('Test ActivityPub videos search', function () { | |||
30 | await setAccessTokensToServers(servers) | 30 | await setAccessTokensToServers(servers) |
31 | 31 | ||
32 | { | 32 | { |
33 | const { uuid } = await servers[0].videosCommand.upload({ attributes: { name: 'video 1 on server 1' } }) | 33 | const { uuid } = await servers[0].videos.upload({ attributes: { name: 'video 1 on server 1' } }) |
34 | videoServer1UUID = uuid | 34 | videoServer1UUID = uuid |
35 | } | 35 | } |
36 | 36 | ||
37 | { | 37 | { |
38 | const { uuid } = await servers[1].videosCommand.upload({ attributes: { name: 'video 1 on server 2' } }) | 38 | const { uuid } = await servers[1].videos.upload({ attributes: { name: 'video 1 on server 2' } }) |
39 | videoServer2UUID = uuid | 39 | videoServer2UUID = uuid |
40 | } | 40 | } |
41 | 41 | ||
42 | await waitJobs(servers) | 42 | await waitJobs(servers) |
43 | 43 | ||
44 | command = servers[0].searchCommand | 44 | command = servers[0].search |
45 | }) | 45 | }) |
46 | 46 | ||
47 | it('Should not find a remote video', async function () { | 47 | it('Should not find a remote video', async function () { |
@@ -105,7 +105,7 @@ describe('Test ActivityPub videos search', function () { | |||
105 | }) | 105 | }) |
106 | 106 | ||
107 | it('Should not list this remote video', async function () { | 107 | it('Should not list this remote video', async function () { |
108 | const { total, data } = await servers[0].videosCommand.list() | 108 | const { total, data } = await servers[0].videos.list() |
109 | expect(total).to.equal(1) | 109 | expect(total).to.equal(1) |
110 | expect(data).to.have.lengthOf(1) | 110 | expect(data).to.have.lengthOf(1) |
111 | expect(data[0].name).to.equal('video 1 on server 1') | 111 | expect(data[0].name).to.equal('video 1 on server 1') |
@@ -118,7 +118,7 @@ describe('Test ActivityPub videos search', function () { | |||
118 | name: 'super_channel', | 118 | name: 'super_channel', |
119 | displayName: 'super channel' | 119 | displayName: 'super channel' |
120 | } | 120 | } |
121 | const created = await servers[1].channelsCommand.create({ attributes: channelAttributes }) | 121 | const created = await servers[1].channels.create({ attributes: channelAttributes }) |
122 | const videoChannelId = created.id | 122 | const videoChannelId = created.id |
123 | 123 | ||
124 | const attributes = { | 124 | const attributes = { |
@@ -127,7 +127,7 @@ describe('Test ActivityPub videos search', function () { | |||
127 | privacy: VideoPrivacy.UNLISTED, | 127 | privacy: VideoPrivacy.UNLISTED, |
128 | channelId: videoChannelId | 128 | channelId: videoChannelId |
129 | } | 129 | } |
130 | await servers[1].videosCommand.update({ id: videoServer2UUID, attributes }) | 130 | await servers[1].videos.update({ id: videoServer2UUID, attributes }) |
131 | 131 | ||
132 | await waitJobs(servers) | 132 | await waitJobs(servers) |
133 | // Expire video | 133 | // Expire video |
@@ -153,7 +153,7 @@ describe('Test ActivityPub videos search', function () { | |||
153 | it('Should delete video of server 2, and delete it on server 1', async function () { | 153 | it('Should delete video of server 2, and delete it on server 1', async function () { |
154 | this.timeout(120000) | 154 | this.timeout(120000) |
155 | 155 | ||
156 | await servers[1].videosCommand.remove({ id: videoServer2UUID }) | 156 | await servers[1].videos.remove({ id: videoServer2UUID }) |
157 | 157 | ||
158 | await waitJobs(servers) | 158 | await waitJobs(servers) |
159 | // Expire video | 159 | // Expire video |
diff --git a/server/tests/api/search/search-channels.ts b/server/tests/api/search/search-channels.ts index 4d2104708..7035fbd62 100644 --- a/server/tests/api/search/search-channels.ts +++ b/server/tests/api/search/search-channels.ts | |||
@@ -19,15 +19,15 @@ describe('Test channels search', function () { | |||
19 | await setAccessTokensToServers([ server ]) | 19 | await setAccessTokensToServers([ server ]) |
20 | 20 | ||
21 | { | 21 | { |
22 | await server.usersCommand.create({ username: 'user1', password: 'password' }) | 22 | await server.users.create({ username: 'user1', password: 'password' }) |
23 | const channel = { | 23 | const channel = { |
24 | name: 'squall_channel', | 24 | name: 'squall_channel', |
25 | displayName: 'Squall channel' | 25 | displayName: 'Squall channel' |
26 | } | 26 | } |
27 | await server.channelsCommand.create({ attributes: channel }) | 27 | await server.channels.create({ attributes: channel }) |
28 | } | 28 | } |
29 | 29 | ||
30 | command = server.searchCommand | 30 | command = server.search |
31 | }) | 31 | }) |
32 | 32 | ||
33 | it('Should make a simple search and not have results', async function () { | 33 | it('Should make a simple search and not have results', async function () { |
diff --git a/server/tests/api/search/search-index.ts b/server/tests/api/search/search-index.ts index d5dc40f60..b54c0da22 100644 --- a/server/tests/api/search/search-index.ts +++ b/server/tests/api/search/search-index.ts | |||
@@ -20,9 +20,9 @@ describe('Test videos search', function () { | |||
20 | 20 | ||
21 | await setAccessTokensToServers([ server ]) | 21 | await setAccessTokensToServers([ server ]) |
22 | 22 | ||
23 | await server.videosCommand.upload({ attributes: { name: localVideoName } }) | 23 | await server.videos.upload({ attributes: { name: localVideoName } }) |
24 | 24 | ||
25 | command = server.searchCommand | 25 | command = server.search |
26 | }) | 26 | }) |
27 | 27 | ||
28 | describe('Default search', async function () { | 28 | describe('Default search', async function () { |
@@ -30,7 +30,7 @@ describe('Test videos search', function () { | |||
30 | it('Should make a local videos search by default', async function () { | 30 | it('Should make a local videos search by default', async function () { |
31 | this.timeout(10000) | 31 | this.timeout(10000) |
32 | 32 | ||
33 | await server.configCommand.updateCustomSubConfig({ | 33 | await server.config.updateCustomSubConfig({ |
34 | newConfig: { | 34 | newConfig: { |
35 | search: { | 35 | search: { |
36 | searchIndex: { | 36 | searchIndex: { |
@@ -57,7 +57,7 @@ describe('Test videos search', function () { | |||
57 | }) | 57 | }) |
58 | 58 | ||
59 | it('Should make an index videos search by default', async function () { | 59 | it('Should make an index videos search by default', async function () { |
60 | await server.configCommand.updateCustomSubConfig({ | 60 | await server.config.updateCustomSubConfig({ |
61 | newConfig: { | 61 | newConfig: { |
62 | search: { | 62 | search: { |
63 | searchIndex: { | 63 | searchIndex: { |
@@ -79,7 +79,7 @@ describe('Test videos search', function () { | |||
79 | }) | 79 | }) |
80 | 80 | ||
81 | it('Should make an index videos search if local search is disabled', async function () { | 81 | it('Should make an index videos search if local search is disabled', async function () { |
82 | await server.configCommand.updateCustomSubConfig({ | 82 | await server.config.updateCustomSubConfig({ |
83 | newConfig: { | 83 | newConfig: { |
84 | search: { | 84 | search: { |
85 | searchIndex: { | 85 | searchIndex: { |
@@ -213,7 +213,7 @@ describe('Test videos search', function () { | |||
213 | let nsfwUUID: string | 213 | let nsfwUUID: string |
214 | 214 | ||
215 | { | 215 | { |
216 | await server.configCommand.updateCustomSubConfig({ | 216 | await server.config.updateCustomSubConfig({ |
217 | newConfig: { | 217 | newConfig: { |
218 | instance: { defaultNSFWPolicy: 'display' } | 218 | instance: { defaultNSFWPolicy: 'display' } |
219 | } | 219 | } |
@@ -229,7 +229,7 @@ describe('Test videos search', function () { | |||
229 | } | 229 | } |
230 | 230 | ||
231 | { | 231 | { |
232 | await server.configCommand.updateCustomSubConfig({ | 232 | await server.config.updateCustomSubConfig({ |
233 | newConfig: { | 233 | newConfig: { |
234 | instance: { defaultNSFWPolicy: 'do_not_list' } | 234 | instance: { defaultNSFWPolicy: 'do_not_list' } |
235 | } | 235 | } |
diff --git a/server/tests/api/search/search-playlists.ts b/server/tests/api/search/search-playlists.ts index 2e4773ed6..e15128c8e 100644 --- a/server/tests/api/search/search-playlists.ts +++ b/server/tests/api/search/search-playlists.ts | |||
@@ -26,40 +26,40 @@ describe('Test playlists search', function () { | |||
26 | await setAccessTokensToServers([ server ]) | 26 | await setAccessTokensToServers([ server ]) |
27 | await setDefaultVideoChannel([ server ]) | 27 | await setDefaultVideoChannel([ server ]) |
28 | 28 | ||
29 | const videoId = (await server.videosCommand.quickUpload({ name: 'video' })).uuid | 29 | const videoId = (await server.videos.quickUpload({ name: 'video' })).uuid |
30 | 30 | ||
31 | { | 31 | { |
32 | const attributes = { | 32 | const attributes = { |
33 | displayName: 'Dr. Kenzo Tenma hospital videos', | 33 | displayName: 'Dr. Kenzo Tenma hospital videos', |
34 | privacy: VideoPlaylistPrivacy.PUBLIC, | 34 | privacy: VideoPlaylistPrivacy.PUBLIC, |
35 | videoChannelId: server.videoChannel.id | 35 | videoChannelId: server.store.channel.id |
36 | } | 36 | } |
37 | const created = await server.playlistsCommand.create({ attributes }) | 37 | const created = await server.playlists.create({ attributes }) |
38 | 38 | ||
39 | await server.playlistsCommand.addElement({ playlistId: created.id, attributes: { videoId } }) | 39 | await server.playlists.addElement({ playlistId: created.id, attributes: { videoId } }) |
40 | } | 40 | } |
41 | 41 | ||
42 | { | 42 | { |
43 | const attributes = { | 43 | const attributes = { |
44 | displayName: 'Johan & Anna Libert musics', | 44 | displayName: 'Johan & Anna Libert musics', |
45 | privacy: VideoPlaylistPrivacy.PUBLIC, | 45 | privacy: VideoPlaylistPrivacy.PUBLIC, |
46 | videoChannelId: server.videoChannel.id | 46 | videoChannelId: server.store.channel.id |
47 | } | 47 | } |
48 | const created = await server.playlistsCommand.create({ attributes }) | 48 | const created = await server.playlists.create({ attributes }) |
49 | 49 | ||
50 | await server.playlistsCommand.addElement({ playlistId: created.id, attributes: { videoId } }) | 50 | await server.playlists.addElement({ playlistId: created.id, attributes: { videoId } }) |
51 | } | 51 | } |
52 | 52 | ||
53 | { | 53 | { |
54 | const attributes = { | 54 | const attributes = { |
55 | displayName: 'Inspector Lunge playlist', | 55 | displayName: 'Inspector Lunge playlist', |
56 | privacy: VideoPlaylistPrivacy.PUBLIC, | 56 | privacy: VideoPlaylistPrivacy.PUBLIC, |
57 | videoChannelId: server.videoChannel.id | 57 | videoChannelId: server.store.channel.id |
58 | } | 58 | } |
59 | await server.playlistsCommand.create({ attributes }) | 59 | await server.playlists.create({ attributes }) |
60 | } | 60 | } |
61 | 61 | ||
62 | command = server.searchCommand | 62 | command = server.search |
63 | }) | 63 | }) |
64 | 64 | ||
65 | it('Should make a simple search and not have results', async function () { | 65 | it('Should make a simple search and not have results', async function () { |
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts index 148499d5f..478ebafc9 100644 --- a/server/tests/api/search/search-videos.ts +++ b/server/tests/api/search/search-videos.ts | |||
@@ -40,24 +40,24 @@ describe('Test videos search', function () { | |||
40 | nsfw: false, | 40 | nsfw: false, |
41 | language: 'fr' | 41 | language: 'fr' |
42 | } | 42 | } |
43 | await server.videosCommand.upload({ attributes: attributes1 }) | 43 | await server.videos.upload({ attributes: attributes1 }) |
44 | 44 | ||
45 | const attributes2 = { ...attributes1, name: attributes1.name + ' - 2', fixture: 'video_short.mp4' } | 45 | const attributes2 = { ...attributes1, name: attributes1.name + ' - 2', fixture: 'video_short.mp4' } |
46 | await server.videosCommand.upload({ attributes: attributes2 }) | 46 | await server.videos.upload({ attributes: attributes2 }) |
47 | 47 | ||
48 | { | 48 | { |
49 | const attributes3 = { ...attributes1, name: attributes1.name + ' - 3', language: undefined } | 49 | const attributes3 = { ...attributes1, name: attributes1.name + ' - 3', language: undefined } |
50 | const { id, uuid } = await server.videosCommand.upload({ attributes: attributes3 }) | 50 | const { id, uuid } = await server.videos.upload({ attributes: attributes3 }) |
51 | videoUUID = uuid | 51 | videoUUID = uuid |
52 | 52 | ||
53 | await server.captionsCommand.createVideoCaption({ | 53 | await server.captions.createVideoCaption({ |
54 | language: 'en', | 54 | language: 'en', |
55 | videoId: id, | 55 | videoId: id, |
56 | fixture: 'subtitle-good2.vtt', | 56 | fixture: 'subtitle-good2.vtt', |
57 | mimeType: 'application/octet-stream' | 57 | mimeType: 'application/octet-stream' |
58 | }) | 58 | }) |
59 | 59 | ||
60 | await server.captionsCommand.createVideoCaption({ | 60 | await server.captions.createVideoCaption({ |
61 | language: 'aa', | 61 | language: 'aa', |
62 | videoId: id, | 62 | videoId: id, |
63 | fixture: 'subtitle-good2.vtt', | 63 | fixture: 'subtitle-good2.vtt', |
@@ -66,23 +66,23 @@ describe('Test videos search', function () { | |||
66 | } | 66 | } |
67 | 67 | ||
68 | const attributes4 = { ...attributes1, name: attributes1.name + ' - 4', language: 'pl', nsfw: true } | 68 | const attributes4 = { ...attributes1, name: attributes1.name + ' - 4', language: 'pl', nsfw: true } |
69 | await server.videosCommand.upload({ attributes: attributes4 }) | 69 | await server.videos.upload({ attributes: attributes4 }) |
70 | 70 | ||
71 | await wait(1000) | 71 | await wait(1000) |
72 | 72 | ||
73 | startDate = new Date().toISOString() | 73 | startDate = new Date().toISOString() |
74 | 74 | ||
75 | const attributes5 = { ...attributes1, name: attributes1.name + ' - 5', licence: 2, language: undefined } | 75 | const attributes5 = { ...attributes1, name: attributes1.name + ' - 5', licence: 2, language: undefined } |
76 | await server.videosCommand.upload({ attributes: attributes5 }) | 76 | await server.videos.upload({ attributes: attributes5 }) |
77 | 77 | ||
78 | const attributes6 = { ...attributes1, name: attributes1.name + ' - 6', tags: [ 't1', 't2' ] } | 78 | const attributes6 = { ...attributes1, name: attributes1.name + ' - 6', tags: [ 't1', 't2' ] } |
79 | await server.videosCommand.upload({ attributes: attributes6 }) | 79 | await server.videos.upload({ attributes: attributes6 }) |
80 | 80 | ||
81 | const attributes7 = { ...attributes1, name: attributes1.name + ' - 7', originallyPublishedAt: '2019-02-12T09:58:08.286Z' } | 81 | const attributes7 = { ...attributes1, name: attributes1.name + ' - 7', originallyPublishedAt: '2019-02-12T09:58:08.286Z' } |
82 | await server.videosCommand.upload({ attributes: attributes7 }) | 82 | await server.videos.upload({ attributes: attributes7 }) |
83 | 83 | ||
84 | const attributes8 = { ...attributes1, name: attributes1.name + ' - 8', licence: 4 } | 84 | const attributes8 = { ...attributes1, name: attributes1.name + ' - 8', licence: 4 } |
85 | await server.videosCommand.upload({ attributes: attributes8 }) | 85 | await server.videos.upload({ attributes: attributes8 }) |
86 | } | 86 | } |
87 | 87 | ||
88 | { | 88 | { |
@@ -93,9 +93,9 @@ describe('Test videos search', function () { | |||
93 | licence: 2, | 93 | licence: 2, |
94 | language: 'en' | 94 | language: 'en' |
95 | } | 95 | } |
96 | await server.videosCommand.upload({ attributes: attributes }) | 96 | await server.videos.upload({ attributes: attributes }) |
97 | 97 | ||
98 | await server.videosCommand.upload({ attributes: { ...attributes, name: attributes.name + ' duplicate' } }) | 98 | await server.videos.upload({ attributes: { ...attributes, name: attributes.name + ' duplicate' } }) |
99 | } | 99 | } |
100 | 100 | ||
101 | { | 101 | { |
@@ -106,7 +106,7 @@ describe('Test videos search', function () { | |||
106 | licence: 3, | 106 | licence: 3, |
107 | language: 'pl' | 107 | language: 'pl' |
108 | } | 108 | } |
109 | await server.videosCommand.upload({ attributes: attributes }) | 109 | await server.videos.upload({ attributes: attributes }) |
110 | } | 110 | } |
111 | 111 | ||
112 | { | 112 | { |
@@ -115,11 +115,11 @@ describe('Test videos search', function () { | |||
115 | tags: [ 'aaaa', 'bbbb', 'cccc' ], | 115 | tags: [ 'aaaa', 'bbbb', 'cccc' ], |
116 | category: 1 | 116 | category: 1 |
117 | } | 117 | } |
118 | await server.videosCommand.upload({ attributes: attributes1 }) | 118 | await server.videos.upload({ attributes: attributes1 }) |
119 | await server.videosCommand.upload({ attributes: { ...attributes1, category: 2 } }) | 119 | await server.videos.upload({ attributes: { ...attributes1, category: 2 } }) |
120 | 120 | ||
121 | await server.videosCommand.upload({ attributes: { ...attributes1, tags: [ 'cccc', 'dddd' ] } }) | 121 | await server.videos.upload({ attributes: { ...attributes1, tags: [ 'cccc', 'dddd' ] } }) |
122 | await server.videosCommand.upload({ attributes: { ...attributes1, tags: [ 'eeee', 'ffff' ] } }) | 122 | await server.videos.upload({ attributes: { ...attributes1, tags: [ 'eeee', 'ffff' ] } }) |
123 | } | 123 | } |
124 | 124 | ||
125 | { | 125 | { |
@@ -127,11 +127,11 @@ describe('Test videos search', function () { | |||
127 | name: 'aaaa 2', | 127 | name: 'aaaa 2', |
128 | category: 1 | 128 | category: 1 |
129 | } | 129 | } |
130 | await server.videosCommand.upload({ attributes: attributes1 }) | 130 | await server.videos.upload({ attributes: attributes1 }) |
131 | await server.videosCommand.upload({ attributes: { ...attributes1, category: 2 } }) | 131 | await server.videos.upload({ attributes: { ...attributes1, category: 2 } }) |
132 | } | 132 | } |
133 | 133 | ||
134 | command = server.searchCommand | 134 | command = server.search |
135 | }) | 135 | }) |
136 | 136 | ||
137 | it('Should make a simple search and not have results', async function () { | 137 | it('Should make a simple search and not have results', async function () { |
@@ -479,7 +479,7 @@ describe('Test videos search', function () { | |||
479 | }, | 479 | }, |
480 | live: { enabled: true } | 480 | live: { enabled: true } |
481 | } | 481 | } |
482 | await server.configCommand.updateCustomSubConfig({ newConfig }) | 482 | await server.config.updateCustomSubConfig({ newConfig }) |
483 | } | 483 | } |
484 | 484 | ||
485 | { | 485 | { |
@@ -490,9 +490,9 @@ describe('Test videos search', function () { | |||
490 | } | 490 | } |
491 | 491 | ||
492 | { | 492 | { |
493 | const liveCommand = server.liveCommand | 493 | const liveCommand = server.live |
494 | 494 | ||
495 | const liveAttributes = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.videoChannel.id } | 495 | const liveAttributes = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.store.channel.id } |
496 | const live = await liveCommand.create({ fields: liveAttributes }) | 496 | const live = await liveCommand.create({ fields: liveAttributes }) |
497 | 497 | ||
498 | const ffmpegCommand = await liveCommand.sendRTMPStreamInVideo({ videoId: live.id }) | 498 | const ffmpegCommand = await liveCommand.sendRTMPStreamInVideo({ videoId: live.id }) |