diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-28 13:59:22 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-28 13:59:22 +0100 |
commit | c5d31dba56d669c0df0209761c43c5a6ac7cec4a (patch) | |
tree | fe72b56a1c0e7beb6e092c393a00ddfe93a5d71f /server/tests/api/config.ts | |
parent | db799da3d2b2ea465165df78ff71effa653b6309 (diff) | |
download | PeerTube-c5d31dba56d669c0df0209761c43c5a6ac7cec4a.tar.gz PeerTube-c5d31dba56d669c0df0209761c43c5a6ac7cec4a.tar.zst PeerTube-c5d31dba56d669c0df0209761c43c5a6ac7cec4a.zip |
Tests directories refractor
Diffstat (limited to 'server/tests/api/config.ts')
-rw-r--r-- | server/tests/api/config.ts | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/server/tests/api/config.ts b/server/tests/api/config.ts deleted file mode 100644 index 61ae57977..000000000 --- a/server/tests/api/config.ts +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* tslint:disable:no-unused-expression */ | ||
2 | |||
3 | import 'mocha' | ||
4 | import * as chai from 'chai' | ||
5 | const expect = chai.expect | ||
6 | |||
7 | import { | ||
8 | getConfig, | ||
9 | flushTests, | ||
10 | runServer, | ||
11 | registerUser | ||
12 | } from '../utils' | ||
13 | |||
14 | describe('Test config', function () { | ||
15 | let server = null | ||
16 | |||
17 | before(async function () { | ||
18 | this.timeout(10000) | ||
19 | |||
20 | await flushTests() | ||
21 | server = await runServer(1) | ||
22 | }) | ||
23 | |||
24 | it('Should have a correct config on a server with registration enabled', async function () { | ||
25 | const res = await getConfig(server.url) | ||
26 | const data = res.body | ||
27 | |||
28 | expect(data.signup.allowed).to.be.true | ||
29 | }) | ||
30 | |||
31 | it('Should have a correct config on a server with registration enabled and a users limit', async function () { | ||
32 | this.timeout(5000) | ||
33 | |||
34 | await Promise.all([ | ||
35 | registerUser(server.url, 'user1', 'super password'), | ||
36 | registerUser(server.url, 'user2', 'super password'), | ||
37 | registerUser(server.url, 'user3', 'super password') | ||
38 | ]) | ||
39 | |||
40 | const res = await getConfig(server.url) | ||
41 | const data = res.body | ||
42 | |||
43 | expect(data.signup.allowed).to.be.false | ||
44 | }) | ||
45 | |||
46 | after(async function () { | ||
47 | process.kill(-server.app.pid) | ||
48 | |||
49 | // Keep the logs if the test failed | ||
50 | if (this['ok']) { | ||
51 | await flushTests() | ||
52 | } | ||
53 | }) | ||
54 | }) | ||