aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/metrics.ts27
-rw-r--r--server/tests/api/server/open-telemetry.ts2
2 files changed, 25 insertions, 4 deletions
diff --git a/server/tests/api/check-params/metrics.ts b/server/tests/api/check-params/metrics.ts
index be8253217..25443401d 100644
--- a/server/tests/api/check-params/metrics.ts
+++ b/server/tests/api/check-params/metrics.ts
@@ -89,10 +89,6 @@ describe('Test metrics API validators', function () {
89 }) 89 })
90 }) 90 })
91 91
92 it('Should fail with a missing errors', async function () {
93
94 })
95
96 it('Should fail with an missing/invalid errors', async function () { 92 it('Should fail with an missing/invalid errors', async function () {
97 await makePostBodyRequest({ 93 await makePostBodyRequest({
98 url: server.url, 94 url: server.url,
@@ -149,6 +145,22 @@ describe('Test metrics API validators', function () {
149 }) 145 })
150 }) 146 })
151 147
148 it('Should fail with an invalid p2pEnabled', async function () {
149 await makePostBodyRequest({
150 url: server.url,
151 path,
152 fields: { ...baseParams, p2pEnabled: 'toto' }
153 })
154 })
155
156 it('Should fail with an invalid totalPeers', async function () {
157 await makePostBodyRequest({
158 url: server.url,
159 path,
160 fields: { ...baseParams, totalPeers: 'toto' }
161 })
162 })
163
152 it('Should fail with a bad video id', async function () { 164 it('Should fail with a bad video id', async function () {
153 await makePostBodyRequest({ 165 await makePostBodyRequest({
154 url: server.url, 166 url: server.url,
@@ -173,6 +185,13 @@ describe('Test metrics API validators', function () {
173 fields: baseParams, 185 fields: baseParams,
174 expectedStatus: HttpStatusCode.NO_CONTENT_204 186 expectedStatus: HttpStatusCode.NO_CONTENT_204
175 }) 187 })
188
189 await makePostBodyRequest({
190 url: server.url,
191 path,
192 fields: { ...baseParams, p2pEnabled: false, totalPeers: 32 },
193 expectedStatus: HttpStatusCode.NO_CONTENT_204
194 })
176 }) 195 })
177 }) 196 })
178 197
diff --git a/server/tests/api/server/open-telemetry.ts b/server/tests/api/server/open-telemetry.ts
index fd85fc514..0bd0b5e86 100644
--- a/server/tests/api/server/open-telemetry.ts
+++ b/server/tests/api/server/open-telemetry.ts
@@ -62,6 +62,8 @@ describe('Open Telemetry', function () {
62 downloadedBytesP2P: 0, 62 downloadedBytesP2P: 0,
63 downloadedBytesHTTP: 0, 63 downloadedBytesHTTP: 0,
64 uploadedBytesP2P: 5, 64 uploadedBytesP2P: 5,
65 totalPeers: 1,
66 p2pEnabled: false,
65 videoId: video.uuid 67 videoId: video.uuid
66 } 68 }
67 }) 69 })