diff options
Diffstat (limited to 'server/tests/api/videos/videos-history.ts')
-rw-r--r-- | server/tests/api/videos/videos-history.ts | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/server/tests/api/videos/videos-history.ts b/server/tests/api/videos/videos-history.ts index 8614078f1..4b5e581d1 100644 --- a/server/tests/api/videos/videos-history.ts +++ b/server/tests/api/videos/videos-history.ts | |||
@@ -33,20 +33,20 @@ describe('Test videos history', function () { | |||
33 | 33 | ||
34 | await setAccessTokensToServers([ server ]) | 34 | await setAccessTokensToServers([ server ]) |
35 | 35 | ||
36 | command = server.historyCommand | 36 | command = server.history |
37 | 37 | ||
38 | { | 38 | { |
39 | const { uuid } = await server.videosCommand.upload({ attributes: { name: 'video 1' } }) | 39 | const { uuid } = await server.videos.upload({ attributes: { name: 'video 1' } }) |
40 | video1UUID = uuid | 40 | video1UUID = uuid |
41 | } | 41 | } |
42 | 42 | ||
43 | { | 43 | { |
44 | const { uuid } = await server.videosCommand.upload({ attributes: { name: 'video 2' } }) | 44 | const { uuid } = await server.videos.upload({ attributes: { name: 'video 2' } }) |
45 | video2UUID = uuid | 45 | video2UUID = uuid |
46 | } | 46 | } |
47 | 47 | ||
48 | { | 48 | { |
49 | const { uuid } = await server.videosCommand.upload({ attributes: { name: 'video 3' } }) | 49 | const { uuid } = await server.videos.upload({ attributes: { name: 'video 3' } }) |
50 | video3UUID = uuid | 50 | video3UUID = uuid |
51 | } | 51 | } |
52 | 52 | ||
@@ -54,15 +54,15 @@ describe('Test videos history', function () { | |||
54 | username: 'user_1', | 54 | username: 'user_1', |
55 | password: 'super password' | 55 | password: 'super password' |
56 | } | 56 | } |
57 | await server.usersCommand.create({ username: user.username, password: user.password }) | 57 | await server.users.create({ username: user.username, password: user.password }) |
58 | userAccessToken = await server.loginCommand.getAccessToken(user) | 58 | userAccessToken = await server.login.getAccessToken(user) |
59 | }) | 59 | }) |
60 | 60 | ||
61 | it('Should get videos, without watching history', async function () { | 61 | it('Should get videos, without watching history', async function () { |
62 | const { data } = await server.videosCommand.listWithToken() | 62 | const { data } = await server.videos.listWithToken() |
63 | 63 | ||
64 | for (const video of data) { | 64 | for (const video of data) { |
65 | const videoDetails = await server.videosCommand.getWithToken({ id: video.id }) | 65 | const videoDetails = await server.videos.getWithToken({ id: video.id }) |
66 | 66 | ||
67 | expect(video.userHistory).to.be.undefined | 67 | expect(video.userHistory).to.be.undefined |
68 | expect(videoDetails.userHistory).to.be.undefined | 68 | expect(videoDetails.userHistory).to.be.undefined |
@@ -78,12 +78,12 @@ describe('Test videos history', function () { | |||
78 | const videosOfVideos: Video[][] = [] | 78 | const videosOfVideos: Video[][] = [] |
79 | 79 | ||
80 | { | 80 | { |
81 | const { data } = await server.videosCommand.listWithToken() | 81 | const { data } = await server.videos.listWithToken() |
82 | videosOfVideos.push(data) | 82 | videosOfVideos.push(data) |
83 | } | 83 | } |
84 | 84 | ||
85 | { | 85 | { |
86 | const body = await server.searchCommand.searchVideos({ token: server.accessToken, search: 'video' }) | 86 | const body = await server.search.searchVideos({ token: server.accessToken, search: 'video' }) |
87 | videosOfVideos.push(body.data) | 87 | videosOfVideos.push(body.data) |
88 | } | 88 | } |
89 | 89 | ||
@@ -102,21 +102,21 @@ describe('Test videos history', function () { | |||
102 | } | 102 | } |
103 | 103 | ||
104 | { | 104 | { |
105 | const videoDetails = await server.videosCommand.getWithToken({ id: video1UUID }) | 105 | const videoDetails = await server.videos.getWithToken({ id: video1UUID }) |
106 | 106 | ||
107 | expect(videoDetails.userHistory).to.not.be.undefined | 107 | expect(videoDetails.userHistory).to.not.be.undefined |
108 | expect(videoDetails.userHistory.currentTime).to.equal(3) | 108 | expect(videoDetails.userHistory.currentTime).to.equal(3) |
109 | } | 109 | } |
110 | 110 | ||
111 | { | 111 | { |
112 | const videoDetails = await server.videosCommand.getWithToken({ id: video2UUID }) | 112 | const videoDetails = await server.videos.getWithToken({ id: video2UUID }) |
113 | 113 | ||
114 | expect(videoDetails.userHistory).to.not.be.undefined | 114 | expect(videoDetails.userHistory).to.not.be.undefined |
115 | expect(videoDetails.userHistory.currentTime).to.equal(8) | 115 | expect(videoDetails.userHistory.currentTime).to.equal(8) |
116 | } | 116 | } |
117 | 117 | ||
118 | { | 118 | { |
119 | const videoDetails = await server.videosCommand.getWithToken({ id: video3UUID }) | 119 | const videoDetails = await server.videos.getWithToken({ id: video3UUID }) |
120 | 120 | ||
121 | expect(videoDetails.userHistory).to.be.undefined | 121 | expect(videoDetails.userHistory).to.be.undefined |
122 | } | 122 | } |
@@ -164,7 +164,7 @@ describe('Test videos history', function () { | |||
164 | }) | 164 | }) |
165 | 165 | ||
166 | it('Should disable videos history', async function () { | 166 | it('Should disable videos history', async function () { |
167 | await server.usersCommand.updateMe({ | 167 | await server.users.updateMe({ |
168 | videosHistoryEnabled: false | 168 | videosHistoryEnabled: false |
169 | }) | 169 | }) |
170 | 170 | ||
@@ -172,7 +172,7 @@ describe('Test videos history', function () { | |||
172 | }) | 172 | }) |
173 | 173 | ||
174 | it('Should re-enable videos history', async function () { | 174 | it('Should re-enable videos history', async function () { |
175 | await server.usersCommand.updateMe({ | 175 | await server.users.updateMe({ |
176 | videosHistoryEnabled: true | 176 | videosHistoryEnabled: true |
177 | }) | 177 | }) |
178 | 178 | ||