- const videoAttributes = {
- name: 'super user video',
- fixture: 'video_short.webm'
- }
- await uploadVideo(server.url, accessTokenUser, videoAttributes)
+ it('Should be able to get user information', async function () {
+ const res1 = await getMyUserInformation(server.url, accessTokenUser)
+ const userMe: MyUser = res1.body
+
+ const res2 = await getUserInformation(server.url, server.accessToken, userMe.id, true)
+ const userGet: User = res2.body
+
+ for (const user of [ userMe, userGet ]) {
+ expect(user.username).to.equal('user_1')
+ expect(user.email).to.equal('user_1@example.com')
+ expect(user.nsfwPolicy).to.equal('display')
+ expect(user.videoQuota).to.equal(2 * 1024 * 1024)
+ expect(user.roleLabel).to.equal('User')
+ expect(user.id).to.be.a('number')
+ expect(user.account.displayName).to.equal('user_1')
+ expect(user.account.description).to.be.null
+ }
+
+ expect(userMe.adminFlags).to.be.undefined
+ expect(userGet.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK)
+
+ expect(userMe.specialPlaylists).to.have.lengthOf(1)
+ expect(userMe.specialPlaylists[0].type).to.equal(VideoPlaylistType.WATCH_LATER)
+
+ // Check stats are included with withStats
+ expect(userGet.videosCount).to.be.a('number')
+ expect(userGet.videosCount).to.equal(0)
+ expect(userGet.videoCommentsCount).to.be.a('number')
+ expect(userGet.videoCommentsCount).to.equal(0)
+ expect(userGet.videoAbusesCount).to.be.a('number')
+ expect(userGet.videoAbusesCount).to.equal(0)
+ expect(userGet.videoAbusesAcceptedCount).to.be.a('number')
+ expect(userGet.videoAbusesAcceptedCount).to.equal(0)
+ })