aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/plugin-helpers.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 10:42:24 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commitc0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea (patch)
treebaf29753ac5d4598643e3bee719f8df0cc36c59d /server/tests/plugins/plugin-helpers.ts
parent08642a765ea514a00f159db898edf14c376fbe6c (diff)
downloadPeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.gz
PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.zst
PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.zip
Refactor requests
Diffstat (limited to 'server/tests/plugins/plugin-helpers.ts')
-rw-r--r--server/tests/plugins/plugin-helpers.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.ts
index 1d87b84ae..5cb664bda 100644
--- a/server/tests/plugins/plugin-helpers.ts
+++ b/server/tests/plugins/plugin-helpers.ts
@@ -2,7 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/core-utils' 5import { HttpStatusCode } from '@shared/models'
6import { 6import {
7 checkVideoFilesWereRemoved, 7 checkVideoFilesWereRemoved,
8 cleanupTests, 8 cleanupTests,
@@ -24,7 +24,7 @@ function postCommand (server: PeerTubeServer, command: string, bodyArg?: object)
24 url: server.url, 24 url: server.url,
25 path: '/plugins/test-four/router/commander', 25 path: '/plugins/test-four/router/commander',
26 fields: body, 26 fields: body,
27 statusCodeExpected: HttpStatusCode.NO_CONTENT_204 27 expectedStatus: HttpStatusCode.NO_CONTENT_204
28 }) 28 })
29} 29}
30 30
@@ -67,7 +67,7 @@ describe('Test plugin helpers', function () {
67 const res = await makeGetRequest({ 67 const res = await makeGetRequest({
68 url: servers[0].url, 68 url: servers[0].url,
69 path: '/plugins/test-four/router/server-config', 69 path: '/plugins/test-four/router/server-config',
70 statusCodeExpected: HttpStatusCode.OK_200 70 expectedStatus: HttpStatusCode.OK_200
71 }) 71 })
72 72
73 expect(res.body.serverConfig).to.exist 73 expect(res.body.serverConfig).to.exist
@@ -88,7 +88,7 @@ describe('Test plugin helpers', function () {
88 const res = await makeGetRequest({ 88 const res = await makeGetRequest({
89 url: servers[0].url, 89 url: servers[0].url,
90 path: '/plugins/test-four/router/static-route', 90 path: '/plugins/test-four/router/static-route',
91 statusCodeExpected: HttpStatusCode.OK_200 91 expectedStatus: HttpStatusCode.OK_200
92 }) 92 })
93 93
94 expect(res.body.staticRoute).to.equal('/plugins/test-four/0.0.1/static/') 94 expect(res.body.staticRoute).to.equal('/plugins/test-four/0.0.1/static/')
@@ -100,7 +100,7 @@ describe('Test plugin helpers', function () {
100 const res = await makeGetRequest({ 100 const res = await makeGetRequest({
101 url: servers[0].url, 101 url: servers[0].url,
102 path: baseRouter + 'router-route', 102 path: baseRouter + 'router-route',
103 statusCodeExpected: HttpStatusCode.OK_200 103 expectedStatus: HttpStatusCode.OK_200
104 }) 104 })
105 105
106 expect(res.body.routerRoute).to.equal(baseRouter) 106 expect(res.body.routerRoute).to.equal(baseRouter)
@@ -113,7 +113,7 @@ describe('Test plugin helpers', function () {
113 await makeGetRequest({ 113 await makeGetRequest({
114 url: servers[0].url, 114 url: servers[0].url,
115 path: '/plugins/test-four/router/user', 115 path: '/plugins/test-four/router/user',
116 statusCodeExpected: HttpStatusCode.NOT_FOUND_404 116 expectedStatus: HttpStatusCode.NOT_FOUND_404
117 }) 117 })
118 }) 118 })
119 119
@@ -122,7 +122,7 @@ describe('Test plugin helpers', function () {
122 url: servers[0].url, 122 url: servers[0].url,
123 token: servers[0].accessToken, 123 token: servers[0].accessToken,
124 path: '/plugins/test-four/router/user', 124 path: '/plugins/test-four/router/user',
125 statusCodeExpected: HttpStatusCode.OK_200 125 expectedStatus: HttpStatusCode.OK_200
126 }) 126 })
127 127
128 expect(res.body.username).to.equal('root') 128 expect(res.body.username).to.equal('root')
@@ -140,12 +140,12 @@ describe('Test plugin helpers', function () {
140 this.timeout(60000) 140 this.timeout(60000)
141 141
142 { 142 {
143 const res = await await servers[0].videos.quickUpload({ name: 'video server 1' }) 143 const res = await servers[0].videos.quickUpload({ name: 'video server 1' })
144 videoUUIDServer1 = res.uuid 144 videoUUIDServer1 = res.uuid
145 } 145 }
146 146
147 { 147 {
148 await await servers[1].videos.quickUpload({ name: 'video server 2' }) 148 await servers[1].videos.quickUpload({ name: 'video server 2' })
149 } 149 }
150 150
151 await waitJobs(servers) 151 await waitJobs(servers)
@@ -224,7 +224,7 @@ describe('Test plugin helpers', function () {
224 let videoUUID: string 224 let videoUUID: string
225 225
226 before(async () => { 226 before(async () => {
227 const res = await await servers[0].videos.quickUpload({ name: 'video1' }) 227 const res = await servers[0].videos.quickUpload({ name: 'video1' })
228 videoUUID = res.uuid 228 videoUUID = res.uuid
229 }) 229 })
230 230