diff options
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r-- | server/tests/api/users/users.ts | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 33bcc8701..3beea5d50 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -11,7 +11,6 @@ import { | |||
11 | createUser, | 11 | createUser, |
12 | deleteMe, | 12 | deleteMe, |
13 | flushAndRunServer, | 13 | flushAndRunServer, |
14 | getAccountRatings, | ||
15 | getBlacklistedVideosList, | 14 | getBlacklistedVideosList, |
16 | getMyUserInformation, | 15 | getMyUserInformation, |
17 | getMyUserVideoQuotaUsed, | 16 | getMyUserVideoQuotaUsed, |
@@ -194,25 +193,22 @@ describe('Test users', function () { | |||
194 | it('Should retrieve ratings list', async function () { | 193 | it('Should retrieve ratings list', async function () { |
195 | await rateVideo(server.url, accessToken, videoId, 'like') | 194 | await rateVideo(server.url, accessToken, videoId, 'like') |
196 | 195 | ||
197 | const res = await getAccountRatings(server.url, server.user.username, server.accessToken, null, HttpStatusCode.OK_200) | 196 | const body = await server.accountsCommand.listRatings({ accountName: server.user.username }) |
198 | const ratings = res.body | ||
199 | 197 | ||
200 | expect(ratings.total).to.equal(1) | 198 | expect(body.total).to.equal(1) |
201 | expect(ratings.data[0].video.id).to.equal(videoId) | 199 | expect(body.data[0].video.id).to.equal(videoId) |
202 | expect(ratings.data[0].rating).to.equal('like') | 200 | expect(body.data[0].rating).to.equal('like') |
203 | }) | 201 | }) |
204 | 202 | ||
205 | it('Should retrieve ratings list by rating type', async function () { | 203 | it('Should retrieve ratings list by rating type', async function () { |
206 | { | 204 | { |
207 | const res = await getAccountRatings(server.url, server.user.username, server.accessToken, 'like') | 205 | const body = await server.accountsCommand.listRatings({ accountName: server.user.username, rating: 'like' }) |
208 | const ratings = res.body | 206 | expect(body.data.length).to.equal(1) |
209 | expect(ratings.data.length).to.equal(1) | ||
210 | } | 207 | } |
211 | 208 | ||
212 | { | 209 | { |
213 | const res = await getAccountRatings(server.url, server.user.username, server.accessToken, 'dislike') | 210 | const body = await server.accountsCommand.listRatings({ accountName: server.user.username, rating: 'dislike' }) |
214 | const ratings = res.body | 211 | expect(body.data.length).to.equal(0) |
215 | expect(ratings.data.length).to.equal(0) | ||
216 | } | 212 | } |
217 | }) | 213 | }) |
218 | }) | 214 | }) |