aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users/users.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-07 13:38:26 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:17 +0200
commit9fff08cf83f34339df7ed4ac770e1dee536adf9d (patch)
tree36eac5147a12ae257a3e8aaeffae37c9aed23d0a /server/tests/api/users/users.ts
parent87e2635a50ac2decb1c330e55c2ff7b6d07a85de (diff)
downloadPeerTube-9fff08cf83f34339df7ed4ac770e1dee536adf9d.tar.gz
PeerTube-9fff08cf83f34339df7ed4ac770e1dee536adf9d.tar.zst
PeerTube-9fff08cf83f34339df7ed4ac770e1dee536adf9d.zip
Introduce accounts command
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r--server/tests/api/users/users.ts20
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 })