return getMyUserInformation(server.url, server.accessToken)
.then(res => {
const user: User = res.body
- const videoChannelUUID = user.videoChannels[0].uuid
+ const videoChannelName = user.videoChannels[0].name
const accountName = user.account.name + '@' + user.account.host
if (token) {
getVideosListWithToken(server.url, token, query),
searchVideoWithToken(server.url, 'n', token, query),
getAccountVideos(server.url, token, accountName, 0, 5, undefined, query),
- getVideoChannelVideos(server.url, token, videoChannelUUID, 0, 5, undefined, query)
+ getVideoChannelVideos(server.url, token, videoChannelName, 0, 5, undefined, query)
])
}
getVideosList(server.url),
searchVideo(server.url, 'n'),
getAccountVideos(server.url, undefined, accountName, 0, 5),
- getVideoChannelVideos(server.url, undefined, videoChannelUUID, 0, 5)
+ getVideoChannelVideos(server.url, undefined, videoChannelName, 0, 5)
])
})
}
})
it('Should display NSFW videos with blur user NSFW policy', async function () {
+ customConfig.instance.defaultNSFWPolicy = 'do_not_list'
+ await updateCustomConfig(server.url, server.accessToken, customConfig)
+
for (const res of await getVideosFunctions(userAccessToken)) {
expect(res.body.total).to.equal(2)
expect(videos[ 0 ].name).to.equal('normal')
}
})
+
+ it('Should display both videos when the nsfw param === both', async function () {
+ for (const res of await getVideosFunctions(server.accessToken, { nsfw: 'both' })) {
+ expect(res.body.total).to.equal(2)
+
+ const videos = res.body.data
+ expect(videos).to.have.lengthOf(2)
+ expect(videos[ 0 ].name).to.equal('normal')
+ expect(videos[ 1 ].name).to.equal('nsfw')
+ }
+ })
})
after(async function () {