diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-31 17:47:36 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-31 17:51:04 +0100 |
commit | 36f9424ff192b0584a433bc196bced6fcf265808 (patch) | |
tree | 35d9fa5c53b228f5e7fc27bcc82854d035e9dde8 /server/tests/utils | |
parent | 66b16cafb380012d3eca14e524d86f2450e04069 (diff) | |
download | PeerTube-36f9424ff192b0584a433bc196bced6fcf265808.tar.gz PeerTube-36f9424ff192b0584a433bc196bced6fcf265808.tar.zst PeerTube-36f9424ff192b0584a433bc196bced6fcf265808.zip |
Add about page
Diffstat (limited to 'server/tests/utils')
-rw-r--r-- | server/tests/utils/server/config.ts | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/server/tests/utils/server/config.ts b/server/tests/utils/server/config.ts index b6905757a..e5411117a 100644 --- a/server/tests/utils/server/config.ts +++ b/server/tests/utils/server/config.ts | |||
@@ -1,15 +1,24 @@ | |||
1 | import * as request from 'supertest' | ||
2 | import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../' | 1 | import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../' |
3 | import { CustomConfig } from '../../../../shared/models/config/custom-config.model' | 2 | import { CustomConfig } from '../../../../shared/models/config/custom-config.model' |
4 | 3 | ||
5 | function getConfig (url: string) { | 4 | function getConfig (url: string) { |
6 | const path = '/api/v1/config' | 5 | const path = '/api/v1/config' |
7 | 6 | ||
8 | return request(url) | 7 | return makeGetRequest({ |
9 | .get(path) | 8 | url, |
10 | .set('Accept', 'application/json') | 9 | path, |
11 | .expect(200) | 10 | statusCodeExpected: 200 |
12 | .expect('Content-Type', /json/) | 11 | }) |
12 | } | ||
13 | |||
14 | function getAbout (url: string) { | ||
15 | const path = '/api/v1/config/about' | ||
16 | |||
17 | return makeGetRequest({ | ||
18 | url, | ||
19 | path, | ||
20 | statusCodeExpected: 200 | ||
21 | }) | ||
13 | } | 22 | } |
14 | 23 | ||
15 | function getCustomConfig (url: string, token: string, statusCodeExpected = 200) { | 24 | function getCustomConfig (url: string, token: string, statusCodeExpected = 200) { |
@@ -52,5 +61,6 @@ export { | |||
52 | getConfig, | 61 | getConfig, |
53 | getCustomConfig, | 62 | getCustomConfig, |
54 | updateCustomConfig, | 63 | updateCustomConfig, |
64 | getAbout, | ||
55 | deleteCustomConfig | 65 | deleteCustomConfig |
56 | } | 66 | } |