-import { flushTests, getVideosList, killallServers, ServerInfo, setAccessTokensToServers, uploadVideo } from '../../utils/index'
-import { userLogin } from '../../utils/users/login'
-import { createUser } from '../../utils/users/users'
-import { getMyVideos } from '../../utils/videos/videos'
+import {
+ flushTests,
+ getVideosList,
+ killallServers,
+ ServerInfo,
+ setAccessTokensToServers,
+ uploadVideo
+} from '../../../../shared/utils/index'
+import { userLogin } from '../../../../shared/utils/users/login'
+import { createUser } from '../../../../shared/utils/users/users'
+import { getMyVideos } from '../../../../shared/utils/videos/videos'
import { ServerConfig } from '../../../../shared/models'
import { CustomConfig } from '../../../../shared/models/server/custom-config.model'
import { User } from '../../../../shared/models/users'
import { ServerConfig } from '../../../../shared/models'
import { CustomConfig } from '../../../../shared/models/server/custom-config.model'
import { User } from '../../../../shared/models/users'
return getMyUserInformation(server.url, server.accessToken)
.then(res => {
const user: User = res.body
return getMyUserInformation(server.url, server.accessToken)
.then(res => {
const user: User = res.body
getVideosListWithToken(server.url, token, query),
searchVideoWithToken(server.url, 'n', token, query),
getAccountVideos(server.url, token, accountName, 0, 5, undefined, query),
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),
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 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')
+ }
+ })