aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/plugins')
-rw-r--r--server/tests/plugins/filter-hooks.ts21
1 files changed, 20 insertions, 1 deletions
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts
index ec0679b04..b2436fb9e 100644
--- a/server/tests/plugins/filter-hooks.ts
+++ b/server/tests/plugins/filter-hooks.ts
@@ -28,11 +28,12 @@ import {
28 getVideoWithToken, 28 getVideoWithToken,
29 setDefaultVideoChannel, 29 setDefaultVideoChannel,
30 waitJobs, 30 waitJobs,
31 doubleFollow 31 doubleFollow, getConfig, registerUser
32} from '../../../shared/extra-utils' 32} from '../../../shared/extra-utils'
33import { VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model' 33import { VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model'
34import { VideoDetails } from '../../../shared/models/videos' 34import { VideoDetails } from '../../../shared/models/videos'
35import { getYoutubeVideoUrl, importVideo } from '../../../shared/extra-utils/videos/video-imports' 35import { getYoutubeVideoUrl, importVideo } from '../../../shared/extra-utils/videos/video-imports'
36import { ServerConfig } from '@shared/models'
36 37
37const expect = chai.expect 38const expect = chai.expect
38 39
@@ -187,6 +188,24 @@ describe('Test plugin filter hooks', function () {
187 }) 188 })
188 }) 189 })
189 190
191 describe('Should run filter:api.user.signup.allowed.result', function () {
192
193 it('Should run on config endpoint', async function () {
194 const res = await getConfig(servers[0].url)
195 expect((res.body as ServerConfig).signup.allowed).to.be.true
196 })
197
198 it('Should allow a signup', async function () {
199 await registerUser(servers[0].url, 'john', 'password')
200 })
201
202 it('Should not allow a signup', async function () {
203 const res = await registerUser(servers[0].url, 'jma', 'password', 403)
204
205 expect(res.body.error).to.equal('No jma')
206 })
207 })
208
190 after(async function () { 209 after(async function () {
191 await cleanupTests(servers) 210 await cleanupTests(servers)
192 }) 211 })