getVideoChannelVideos,
getVideosList,
getVideosListWithToken,
- searchVideo,
- searchVideoWithToken,
ServerInfo,
setAccessTokensToServers,
updateCustomConfig,
uploadVideo,
userLogin
} from '@shared/extra-utils'
-import { CustomConfig, ServerConfig, User, VideosOverview } from '@shared/models'
+import { BooleanBothQuery, CustomConfig, ServerConfig, User, VideosOverview } from '@shared/models'
const expect = chai.expect
let userAccessToken: string
let customConfig: CustomConfig
- function getVideosFunctions (token?: string, query = {}) {
+ function getVideosFunctions (token?: string, query: { nsfw?: BooleanBothQuery } = {}) {
return getMyUserInformation(server.url, server.accessToken)
.then(res => {
const user: User = res.body
if (token) {
promises = [
getVideosListWithToken(server.url, token, query),
- searchVideoWithToken(server.url, 'n', token, query),
+ server.searchCommand.advancedVideoSearch({ token, search: { search: 'n', ...query } }),
getAccountVideos(server.url, token, accountName, 0, 5, undefined, query),
getVideoChannelVideos(server.url, token, videoChannelName, 0, 5, undefined, query)
]
promises = [
getVideosList(server.url),
- searchVideo(server.url, 'n'),
+ server.searchCommand.searchVideos({ search: 'n' }),
getAccountVideos(server.url, undefined, accountName, 0, 5),
getVideoChannelVideos(server.url, undefined, videoChannelName, 0, 5)
]
})
it('Should display NSFW videos when the nsfw param === true', async function () {
- for (const res of await getVideosFunctions(server.accessToken, { nsfw: true })) {
+ for (const res of await getVideosFunctions(server.accessToken, { nsfw: 'true' })) {
expect(res.body.total).to.equal(1)
const videos = res.body.data
})
it('Should hide NSFW videos when the nsfw param === true', async function () {
- for (const res of await getVideosFunctions(server.accessToken, { nsfw: false })) {
+ for (const res of await getVideosFunctions(server.accessToken, { nsfw: 'false' })) {
expect(res.body.total).to.equal(1)
const videos = res.body.data