checkVideoIsPublished,
cleanupTests,
createUser,
- follow,
generateUserAccessToken,
getAccount,
- getCustomConfig,
getVideoCommentThreads,
getVideoIdFromUUID,
immutableAssign,
removeUserSubscription,
removeVideoFromBlacklist,
ServerInfo,
- unfollow,
- updateCustomConfig,
- updateCustomSubConfig,
uploadVideo,
wait,
waitJobs
const video = resVideo.body.video
{
- const body = await servers[0].abusesCommand.report({ token: userAccessToken, videoId: video.id, reason: 'super reason' })
+ const body = await servers[0].abusesCommand.report({ token: userAccessToken, videoId: video.id, reason: 'super reason' })
abuseId = body.abuse.id
}
it('Should send a notification only to admin when there is a new instance follower', async function () {
this.timeout(20000)
- await follow(servers[2].url, [ servers[0].url ], servers[2].accessToken)
+ await servers[2].followsCommand.follow({ targets: [ servers[0].url ] })
await waitJobs(servers)
it('Should send a notification on auto follow back', async function () {
this.timeout(40000)
- await unfollow(servers[2].url, servers[2].accessToken, servers[0])
+ await servers[2].followsCommand.unfollow({ target: servers[0] })
await waitJobs(servers)
const config = {
}
}
}
- await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config)
+ await servers[0].configCommand.updateCustomSubConfig({ newConfig: config })
- await follow(servers[2].url, [ servers[0].url ], servers[2].accessToken)
+ await servers[2].followsCommand.follow({ targets: [ servers[0].url ] })
await waitJobs(servers)
await checkAutoInstanceFollowing(immutableAssign(baseParams, userOverride), followerHost, followingHost, 'absence')
config.followings.instance.autoFollowBack.enabled = false
- await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config)
- await unfollow(servers[0].url, servers[0].accessToken, servers[2])
- await unfollow(servers[2].url, servers[2].accessToken, servers[0])
+ await servers[0].configCommand.updateCustomSubConfig({ newConfig: config })
+ await servers[0].followsCommand.unfollow({ target: servers[2] })
+ await servers[2].followsCommand.unfollow({ target: servers[0] })
})
it('Should send a notification on auto instances index follow', async function () {
this.timeout(30000)
- await unfollow(servers[0].url, servers[0].accessToken, servers[1])
+ await servers[0].followsCommand.unfollow({ target: servers[1] })
- await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config)
+ await servers[0].configCommand.updateCustomSubConfig({ newConfig: config })
await wait(5000)
await waitJobs(servers)
await checkAutoInstanceFollowing(baseParams, followerHost, followingHost, 'presence')
config.followings.instance.autoFollowIndex.enabled = false
- await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config)
- await unfollow(servers[0].url, servers[0].accessToken, servers[1])
+ await servers[0].configCommand.updateCustomSubConfig({ newConfig: config })
+ await servers[0].followsCommand.unfollow({ target: servers[1] })
})
})
token: userAccessToken
}
- const resCustomConfig = await getCustomConfig(servers[0].url, servers[0].accessToken)
- currentCustomConfig = resCustomConfig.body
+ currentCustomConfig = await servers[0].configCommand.getCustomConfig()
+
const autoBlacklistTestsCustomConfig = immutableAssign(currentCustomConfig, {
autoBlacklist: {
videos: {
}
}
})
+
// enable transcoding otherwise own publish notification after transcoding not expected
autoBlacklistTestsCustomConfig.transcoding.enabled = true
- await updateCustomConfig(servers[0].url, servers[0].accessToken, autoBlacklistTestsCustomConfig)
+ await servers[0].configCommand.updateCustomConfig({ newCustomConfig: autoBlacklistTestsCustomConfig })
await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1_channel@localhost:' + servers[0].port)
await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1_channel@localhost:' + servers[0].port)
})
after(async () => {
- await updateCustomConfig(servers[0].url, servers[0].accessToken, currentCustomConfig)
+ await servers[0].configCommand.updateCustomConfig({ newCustomConfig: currentCustomConfig })
await removeUserSubscription(servers[0].url, servers[0].accessToken, 'user_1_channel@localhost:' + servers[0].port)
await removeUserSubscription(servers[1].url, servers[1].accessToken, 'user_1_channel@localhost:' + servers[0].port)