Add comments federation tests
[oweals/peertube.git] / server / tests / api / users.ts
index 33646e84f2dfbba2bc844a13b9a8e3b75fdfa255..67e4cc8c6ce7bb223d62b3d7d1652b33f3d6c3da 100644 (file)
@@ -113,11 +113,11 @@ describe('Test users', function () {
 
   it('Should upload the video with the correct token', async function () {
     const videoAttributes = {}
-    await uploadVideo(server.url, accessToken, videoAttributes, 204)
+    await uploadVideo(server.url, accessToken, videoAttributes)
     const res = await getVideosList(server.url)
     const video = res.body.data[ 0 ]
 
-    expect(video.account)
+    expect(video.accountName)
       .to
       .equal('root')
     videoId = video.id
@@ -125,7 +125,7 @@ describe('Test users', function () {
 
   it('Should upload the video again with the correct token', async function () {
     const videoAttributes = {}
-    await uploadVideo(server.url, accessToken, videoAttributes, 204)
+    await uploadVideo(server.url, accessToken, videoAttributes)
   })
 
   it('Should retrieve a video rating', async function () {
@@ -415,6 +415,15 @@ describe('Test users', function () {
       .a('number')
   })
 
+  it('Should be able to change the autoPlayVideo attribute', async function () {
+    await updateMyUser(server.url, accessTokenUser, undefined, undefined, undefined, false)
+
+    const res = await getMyUserInformation(server.url, accessTokenUser)
+    const user = res.body
+
+    expect(user.autoPlayVideo).to.be.false
+  })
+
   it('Should be able to change the email display attribute', async function () {
     await updateMyUser(server.url, accessTokenUser, undefined, undefined, 'updated@example.com')
 
@@ -487,7 +496,7 @@ describe('Test users', function () {
       .equal(1)
 
     const video = res.body.data[ 0 ]
-    expect(video.account)
+    expect(video.accountName)
       .to
       .equal('root')
   })