aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorKimsible <kimsible@users.noreply.github.com>2021-04-28 18:26:26 +0200
committerKimsible <kimsible@users.noreply.github.com>2021-05-05 11:47:03 +0200
commit08ac081b37cd6115634e8951608116fe0f13032b (patch)
treeda5c1b338705686093c8fea26e552b16fda7c2cb /server/tests
parent1e37d32f4bdc51045cd85d01ea1035fd53e0d32c (diff)
downloadPeerTube-08ac081b37cd6115634e8951608116fe0f13032b.tar.gz
PeerTube-08ac081b37cd6115634e8951608116fe0f13032b.tar.zst
PeerTube-08ac081b37cd6115634e8951608116fe0f13032b.zip
Add test for API actors route
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/check-params/actors.ts37
1 files changed, 37 insertions, 0 deletions
diff --git a/server/tests/api/check-params/actors.ts b/server/tests/api/check-params/actors.ts
new file mode 100644
index 000000000..3a03edc39
--- /dev/null
+++ b/server/tests/api/check-params/actors.ts
@@ -0,0 +1,37 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2
3import 'mocha'
4
5import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../../shared/extra-utils'
6import { getActor } from '../../../../shared/extra-utils/actors/actors'
7import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
8
9describe('Test actors API validators', function () {
10 let server: ServerInfo
11
12 // ---------------------------------------------------------------
13
14 before(async function () {
15 this.timeout(30000)
16
17 server = await flushAndRunServer(1)
18 })
19
20 describe('When getting an actor', function () {
21 it('Should return 404 with a non existing actorName', async function () {
22 await getActor(server.url, 'arfaze', HttpStatusCode.NOT_FOUND_404)
23 })
24
25 it('Should return 200 with an existing accountName', async function () {
26 await getActor(server.url, 'root', HttpStatusCode.OK_200)
27 })
28
29 it('Should return 200 with an existing channelName', async function () {
30 await getActor(server.url, 'root_channel', HttpStatusCode.OK_200)
31 })
32 })
33
34 after(async function () {
35 await cleanupTests([ server ])
36 })
37})