1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Add signup approval API tests

This commit is contained in:
Chocobozzz 2023-01-19 09:28:29 +01:00 committed by Chocobozzz
parent 3e5716dd3a
commit b379759f55
30 changed files with 1418 additions and 452 deletions

View file

@ -18,6 +18,33 @@ export class ConfigCommand extends AbstractCommand {
}
}
// ---------------------------------------------------------------------------
static getEmailOverrideConfig (emailPort: number) {
return {
smtp: {
hostname: '127.0.0.1',
port: emailPort
}
}
}
// ---------------------------------------------------------------------------
enableSignup (requiresApproval: boolean) {
return this.updateExistingSubConfig({
newConfig: {
signup: {
enabled: true,
requiresApproval,
limit: -1
}
}
})
}
// ---------------------------------------------------------------------------
disableImports () {
return this.setImportsEnabled(false)
}
@ -44,6 +71,16 @@ export class ConfigCommand extends AbstractCommand {
})
}
// ---------------------------------------------------------------------------
enableChannelSync () {
return this.setChannelSyncEnabled(true)
}
disableChannelSync () {
return this.setChannelSyncEnabled(false)
}
private setChannelSyncEnabled (enabled: boolean) {
return this.updateExistingSubConfig({
newConfig: {
@ -56,13 +93,7 @@ export class ConfigCommand extends AbstractCommand {
})
}
enableChannelSync () {
return this.setChannelSyncEnabled(true)
}
disableChannelSync () {
return this.setChannelSyncEnabled(false)
}
// ---------------------------------------------------------------------------
enableLive (options: {
allowReplay?: boolean
@ -142,6 +173,8 @@ export class ConfigCommand extends AbstractCommand {
})
}
// ---------------------------------------------------------------------------
enableStudio () {
return this.updateExistingSubConfig({
newConfig: {
@ -152,6 +185,8 @@ export class ConfigCommand extends AbstractCommand {
})
}
// ---------------------------------------------------------------------------
getConfig (options: OverrideCommandOptions = {}) {
const path = '/api/v1/config'
@ -304,6 +339,7 @@ export class ConfigCommand extends AbstractCommand {
signup: {
enabled: false,
limit: 5,
requiresApproval: true,
requiresEmailVerification: false,
minimumAge: 16
},