]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/tests/api/server/config.ts
chore(refactor): remove shared folder dependencies to the server
[github/Chocobozzz/PeerTube.git] / server / tests / api / server / config.ts
CommitLineData
a1587156 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
0e1dc3e7
C
2
3import 'mocha'
4import * as chai from 'chai'
0e1dc3e7 5import {
7c3b7976 6 cleanupTests,
254d3579 7 createSingleServer,
a1587156 8 killallServers,
8155db66 9 makeGetRequest,
a1587156 10 parallelTests,
254d3579 11 PeerTubeServer,
d23dd9fb 12 setAccessTokensToServers
65e6e260 13} from '@shared/extra-utils'
4c7e60bc 14import { CustomConfig, HttpStatusCode } from '@shared/models'
0e1dc3e7 15
5bcfd029
C
16const expect = chai.expect
17
254d3579 18function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) {
40e87e9e
C
19 expect(data.instance.name).to.equal('PeerTube')
20 expect(data.instance.shortDescription).to.equal(
482fa503 21 'PeerTube, an ActivityPub-federated video streaming platform using P2P directly in your web browser.'
40e87e9e
C
22 )
23 expect(data.instance.description).to.equal('Welcome to this PeerTube instance!')
ccc00cb2 24
40e87e9e 25 expect(data.instance.terms).to.equal('No terms for now.')
8ae03c37 26 expect(data.instance.creationReason).to.be.empty
ccc00cb2
C
27 expect(data.instance.codeOfConduct).to.be.empty
28 expect(data.instance.moderationInformation).to.be.empty
29 expect(data.instance.administrator).to.be.empty
30 expect(data.instance.maintenanceLifetime).to.be.empty
31 expect(data.instance.businessModel).to.be.empty
be04c6fd 32 expect(data.instance.hardwareInformation).to.be.empty
ccc00cb2
C
33
34 expect(data.instance.languages).to.have.lengthOf(0)
35 expect(data.instance.categories).to.have.lengthOf(0)
36
40e87e9e 37 expect(data.instance.defaultClientRoute).to.equal('/videos/trending')
f8802489 38 expect(data.instance.isNSFW).to.be.false
40e87e9e
C
39 expect(data.instance.defaultNSFWPolicy).to.equal('display')
40 expect(data.instance.customizations.css).to.be.empty
41 expect(data.instance.customizations.javascript).to.be.empty
a4101923 42
40e87e9e
C
43 expect(data.services.twitter.username).to.equal('@Chocobozzz')
44 expect(data.services.twitter.whitelisted).to.be.false
a4101923 45
0bc53e20
C
46 expect(data.client.videos.miniature.preferAuthorDisplayName).to.be.false
47 expect(data.client.menu.login.redirectOnSingleExternalAuth).to.be.false
48
40e87e9e
C
49 expect(data.cache.previews.size).to.equal(1)
50 expect(data.cache.captions.size).to.equal(1)
b3d5cb92 51 expect(data.cache.torrents.size).to.equal(1)
a4101923 52
40e87e9e
C
53 expect(data.signup.enabled).to.be.true
54 expect(data.signup.limit).to.equal(4)
1f256e7d 55 expect(data.signup.minimumAge).to.equal(16)
d9eaee39 56 expect(data.signup.requiresEmailVerification).to.be.false
a4101923 57
48f07b4a 58 expect(data.admin.email).to.equal('admin' + server.internalServerNumber + '@example.com')
a4101923
C
59 expect(data.contactForm.enabled).to.be.true
60
40e87e9e 61 expect(data.user.videoQuota).to.equal(5242880)
9ee92651 62 expect(data.user.videoQuotaDaily).to.equal(-1)
c6c0fa6c 63
754b6f5f
FC
64 expect(data.videoChannels.maxPerUser).to.equal(20)
65
40e87e9e 66 expect(data.transcoding.enabled).to.be.false
14e2014a 67 expect(data.transcoding.allowAdditionalExtensions).to.be.false
536598cf 68 expect(data.transcoding.allowAudioFiles).to.be.false
40e87e9e 69 expect(data.transcoding.threads).to.equal(2)
9129b769 70 expect(data.transcoding.concurrency).to.equal(2)
1896bca0 71 expect(data.transcoding.profile).to.equal('default')
8dd754c7 72 expect(data.transcoding.resolutions['144p']).to.be.false
40e87e9e
C
73 expect(data.transcoding.resolutions['240p']).to.be.true
74 expect(data.transcoding.resolutions['360p']).to.be.true
75 expect(data.transcoding.resolutions['480p']).to.be.true
76 expect(data.transcoding.resolutions['720p']).to.be.true
77 expect(data.transcoding.resolutions['1080p']).to.be.true
b7085c71 78 expect(data.transcoding.resolutions['1440p']).to.be.true
db714ab4 79 expect(data.transcoding.resolutions['2160p']).to.be.true
d7a25329 80 expect(data.transcoding.webtorrent.enabled).to.be.true
09209296
C
81 expect(data.transcoding.hls.enabled).to.be.true
82
c6c0fa6c 83 expect(data.live.enabled).to.be.false
c655c9ef 84 expect(data.live.allowReplay).to.be.false
c9bc850e 85 expect(data.live.maxDuration).to.equal(-1)
a056ca48
C
86 expect(data.live.maxInstanceLives).to.equal(20)
87 expect(data.live.maxUserLives).to.equal(3)
c6c0fa6c
C
88 expect(data.live.transcoding.enabled).to.be.false
89 expect(data.live.transcoding.threads).to.equal(2)
1896bca0 90 expect(data.live.transcoding.profile).to.equal('default')
8dd754c7 91 expect(data.live.transcoding.resolutions['144p']).to.be.false
c6c0fa6c
C
92 expect(data.live.transcoding.resolutions['240p']).to.be.false
93 expect(data.live.transcoding.resolutions['360p']).to.be.false
94 expect(data.live.transcoding.resolutions['480p']).to.be.false
95 expect(data.live.transcoding.resolutions['720p']).to.be.false
96 expect(data.live.transcoding.resolutions['1080p']).to.be.false
b7085c71 97 expect(data.live.transcoding.resolutions['1440p']).to.be.false
c6c0fa6c
C
98 expect(data.live.transcoding.resolutions['2160p']).to.be.false
99
9129b769 100 expect(data.import.videos.concurrency).to.equal(2)
5d08a6a7 101 expect(data.import.videos.http.enabled).to.be.true
a84b8fa5 102 expect(data.import.videos.torrent.enabled).to.be.true
7ccddd7b 103 expect(data.autoBlacklist.videos.ofUsers.enabled).to.be.false
5b9c965d
C
104
105 expect(data.followers.instance.enabled).to.be.true
14893eb7 106 expect(data.followers.instance.manualApproval).to.be.false
8424c402
C
107
108 expect(data.followings.instance.autoFollowBack.enabled).to.be.false
109 expect(data.followings.instance.autoFollowIndex.enabled).to.be.false
c9215a1b 110 expect(data.followings.instance.autoFollowIndex.indexUrl).to.equal('')
72c33e71
C
111
112 expect(data.broadcastMessage.enabled).to.be.false
113 expect(data.broadcastMessage.level).to.equal('info')
114 expect(data.broadcastMessage.message).to.equal('')
115 expect(data.broadcastMessage.dismissable).to.be.false
40e87e9e
C
116}
117
118function checkUpdatedConfig (data: CustomConfig) {
119 expect(data.instance.name).to.equal('PeerTube updated')
120 expect(data.instance.shortDescription).to.equal('my short description')
121 expect(data.instance.description).to.equal('my super description')
ccc00cb2 122
40e87e9e 123 expect(data.instance.terms).to.equal('my super terms')
8ae03c37 124 expect(data.instance.creationReason).to.equal('my super creation reason')
ccc00cb2
C
125 expect(data.instance.codeOfConduct).to.equal('my super coc')
126 expect(data.instance.moderationInformation).to.equal('my super moderation information')
127 expect(data.instance.administrator).to.equal('Kuja')
128 expect(data.instance.maintenanceLifetime).to.equal('forever')
129 expect(data.instance.businessModel).to.equal('my super business model')
be04c6fd 130 expect(data.instance.hardwareInformation).to.equal('2vCore 3GB RAM')
ccc00cb2
C
131
132 expect(data.instance.languages).to.deep.equal([ 'en', 'es' ])
133 expect(data.instance.categories).to.deep.equal([ 1, 2 ])
134
40e87e9e 135 expect(data.instance.defaultClientRoute).to.equal('/videos/recently-added')
f8802489 136 expect(data.instance.isNSFW).to.be.true
40e87e9e
C
137 expect(data.instance.defaultNSFWPolicy).to.equal('blur')
138 expect(data.instance.customizations.javascript).to.equal('alert("coucou")')
139 expect(data.instance.customizations.css).to.equal('body { background-color: red; }')
a4101923 140
40e87e9e
C
141 expect(data.services.twitter.username).to.equal('@Kuja')
142 expect(data.services.twitter.whitelisted).to.be.true
a4101923 143
0bc53e20
C
144 expect(data.client.videos.miniature.preferAuthorDisplayName).to.be.true
145 expect(data.client.menu.login.redirectOnSingleExternalAuth).to.be.true
146
40e87e9e
C
147 expect(data.cache.previews.size).to.equal(2)
148 expect(data.cache.captions.size).to.equal(3)
b3d5cb92 149 expect(data.cache.torrents.size).to.equal(4)
a4101923 150
40e87e9e
C
151 expect(data.signup.enabled).to.be.false
152 expect(data.signup.limit).to.equal(5)
576ad67a 153 expect(data.signup.requiresEmailVerification).to.be.false
1f256e7d 154 expect(data.signup.minimumAge).to.equal(10)
a4101923 155
48f07b4a
C
156 // We override admin email in parallel tests, so skip this exception
157 if (parallelTests() === false) {
158 expect(data.admin.email).to.equal('superadmin1@example.com')
159 }
160
a4101923
C
161 expect(data.contactForm.enabled).to.be.false
162
40e87e9e 163 expect(data.user.videoQuota).to.equal(5242881)
bee0abff 164 expect(data.user.videoQuotaDaily).to.equal(318742)
a4101923 165
754b6f5f
FC
166 expect(data.videoChannels.maxPerUser).to.equal(24)
167
40e87e9e
C
168 expect(data.transcoding.enabled).to.be.true
169 expect(data.transcoding.threads).to.equal(1)
9129b769 170 expect(data.transcoding.concurrency).to.equal(3)
14e2014a 171 expect(data.transcoding.allowAdditionalExtensions).to.be.true
536598cf 172 expect(data.transcoding.allowAudioFiles).to.be.true
1896bca0 173 expect(data.transcoding.profile).to.equal('vod_profile')
8dd754c7 174 expect(data.transcoding.resolutions['144p']).to.be.false
40e87e9e
C
175 expect(data.transcoding.resolutions['240p']).to.be.false
176 expect(data.transcoding.resolutions['360p']).to.be.true
177 expect(data.transcoding.resolutions['480p']).to.be.true
178 expect(data.transcoding.resolutions['720p']).to.be.false
179 expect(data.transcoding.resolutions['1080p']).to.be.false
db714ab4 180 expect(data.transcoding.resolutions['2160p']).to.be.false
09209296 181 expect(data.transcoding.hls.enabled).to.be.false
d7a25329 182 expect(data.transcoding.webtorrent.enabled).to.be.true
a4101923 183
c6c0fa6c 184 expect(data.live.enabled).to.be.true
c655c9ef 185 expect(data.live.allowReplay).to.be.true
fb719404 186 expect(data.live.maxDuration).to.equal(5000)
a056ca48
C
187 expect(data.live.maxInstanceLives).to.equal(-1)
188 expect(data.live.maxUserLives).to.equal(10)
c6c0fa6c
C
189 expect(data.live.transcoding.enabled).to.be.true
190 expect(data.live.transcoding.threads).to.equal(4)
1896bca0 191 expect(data.live.transcoding.profile).to.equal('live_profile')
8dd754c7 192 expect(data.live.transcoding.resolutions['144p']).to.be.true
c6c0fa6c
C
193 expect(data.live.transcoding.resolutions['240p']).to.be.true
194 expect(data.live.transcoding.resolutions['360p']).to.be.true
195 expect(data.live.transcoding.resolutions['480p']).to.be.true
196 expect(data.live.transcoding.resolutions['720p']).to.be.true
197 expect(data.live.transcoding.resolutions['1080p']).to.be.true
198 expect(data.live.transcoding.resolutions['2160p']).to.be.true
199
9129b769 200 expect(data.import.videos.concurrency).to.equal(4)
5d08a6a7 201 expect(data.import.videos.http.enabled).to.be.false
a84b8fa5 202 expect(data.import.videos.torrent.enabled).to.be.false
7ccddd7b 203 expect(data.autoBlacklist.videos.ofUsers.enabled).to.be.true
5b9c965d
C
204
205 expect(data.followers.instance.enabled).to.be.false
14893eb7 206 expect(data.followers.instance.manualApproval).to.be.true
8424c402
C
207
208 expect(data.followings.instance.autoFollowBack.enabled).to.be.true
209 expect(data.followings.instance.autoFollowIndex.enabled).to.be.true
210 expect(data.followings.instance.autoFollowIndex.indexUrl).to.equal('https://updated.example.com')
72c33e71
C
211
212 expect(data.broadcastMessage.enabled).to.be.true
213 expect(data.broadcastMessage.level).to.equal('error')
214 expect(data.broadcastMessage.message).to.equal('super bad message')
215 expect(data.broadcastMessage.dismissable).to.be.true
40e87e9e
C
216}
217
8d8a037e
JB
218const newCustomConfig: CustomConfig = {
219 instance: {
220 name: 'PeerTube updated',
221 shortDescription: 'my short description',
222 description: 'my super description',
223 terms: 'my super terms',
224 codeOfConduct: 'my super coc',
225
226 creationReason: 'my super creation reason',
227 moderationInformation: 'my super moderation information',
228 administrator: 'Kuja',
229 maintenanceLifetime: 'forever',
230 businessModel: 'my super business model',
231 hardwareInformation: '2vCore 3GB RAM',
232
233 languages: [ 'en', 'es' ],
234 categories: [ 1, 2 ],
235
236 isNSFW: true,
237 defaultNSFWPolicy: 'blur' as 'blur',
238
239 defaultClientRoute: '/videos/recently-added',
240
241 customizations: {
242 javascript: 'alert("coucou")',
243 css: 'body { background-color: red; }'
244 }
245 },
246 theme: {
247 default: 'default'
248 },
249 services: {
250 twitter: {
251 username: '@Kuja',
252 whitelisted: true
253 }
254 },
0bc53e20
C
255 client: {
256 videos: {
257 miniature: {
258 preferAuthorDisplayName: true
259 }
260 },
261 menu: {
262 login: {
263 redirectOnSingleExternalAuth: true
264 }
265 }
266 },
8d8a037e
JB
267 cache: {
268 previews: {
269 size: 2
270 },
271 captions: {
272 size: 3
273 },
274 torrents: {
275 size: 4
276 }
277 },
278 signup: {
279 enabled: false,
280 limit: 5,
281 requiresEmailVerification: false,
282 minimumAge: 10
283 },
284 admin: {
285 email: 'superadmin1@example.com'
286 },
287 contactForm: {
288 enabled: false
289 },
290 user: {
291 videoQuota: 5242881,
292 videoQuotaDaily: 318742
293 },
754b6f5f
FC
294 videoChannels: {
295 maxPerUser: 24
296 },
8d8a037e
JB
297 transcoding: {
298 enabled: true,
299 allowAdditionalExtensions: true,
300 allowAudioFiles: true,
301 threads: 1,
302 concurrency: 3,
303 profile: 'vod_profile',
304 resolutions: {
305 '0p': false,
8dd754c7 306 '144p': false,
8d8a037e
JB
307 '240p': false,
308 '360p': true,
309 '480p': true,
310 '720p': false,
311 '1080p': false,
312 '1440p': false,
313 '2160p': false
314 },
315 webtorrent: {
316 enabled: true
317 },
318 hls: {
319 enabled: false
320 }
321 },
322 live: {
323 enabled: true,
324 allowReplay: true,
325 maxDuration: 5000,
326 maxInstanceLives: -1,
327 maxUserLives: 10,
328 transcoding: {
329 enabled: true,
330 threads: 4,
331 profile: 'live_profile',
332 resolutions: {
8dd754c7 333 '144p': true,
8d8a037e
JB
334 '240p': true,
335 '360p': true,
336 '480p': true,
337 '720p': true,
338 '1080p': true,
339 '1440p': true,
340 '2160p': true
341 }
342 }
343 },
344 import: {
345 videos: {
346 concurrency: 4,
347 http: {
348 enabled: false
349 },
350 torrent: {
351 enabled: false
352 }
353 }
354 },
355 trending: {
356 videos: {
357 algorithms: {
358 enabled: [ 'best', 'hot', 'most-viewed', 'most-liked' ],
359 default: 'hot'
360 }
361 }
362 },
363 autoBlacklist: {
364 videos: {
365 ofUsers: {
366 enabled: true
367 }
368 }
369 },
370 followers: {
371 instance: {
372 enabled: false,
373 manualApproval: true
374 }
375 },
376 followings: {
377 instance: {
378 autoFollowBack: {
379 enabled: true
380 },
381 autoFollowIndex: {
382 enabled: true,
383 indexUrl: 'https://updated.example.com'
384 }
385 }
386 },
387 broadcastMessage: {
388 enabled: true,
389 level: 'error',
390 message: 'super bad message',
391 dismissable: true
392 },
393 search: {
394 remoteUri: {
395 anonymous: true,
396 users: true
397 },
398 searchIndex: {
399 enabled: true,
400 url: 'https://search.joinpeertube.org',
401 disableLocalSearch: true,
402 isDefaultSearch: true
403 }
404 }
405}
406
407describe('Test static config', function () {
408 let server: PeerTubeServer = null
409
410 before(async function () {
411 this.timeout(30000)
412
cf0c8ee5 413 server = await createSingleServer(1, { webadmin: { configuration: { edition: { allowed: false } } } })
8d8a037e
JB
414 await setAccessTokensToServers([ server ])
415 })
416
417 it('Should tell the client that edits are not allowed', async function () {
418 const data = await server.config.getConfig()
419
cf0c8ee5 420 expect(data.webadmin.configuration.edition.allowed).to.be.false
8d8a037e
JB
421 })
422
423 it('Should error when client tries to update', async function () {
424 await server.config.updateCustomConfig({ newCustomConfig, expectedStatus: 405 })
425 })
f87d82b9
C
426
427 after(async function () {
428 await cleanupTests([ server ])
429 })
8d8a037e
JB
430})
431
0e1dc3e7 432describe('Test config', function () {
254d3579 433 let server: PeerTubeServer = null
0e1dc3e7
C
434
435 before(async function () {
e212f887 436 this.timeout(30000)
48f07b4a 437
254d3579 438 server = await createSingleServer(1)
fd206f0b 439 await setAccessTokensToServers([ server ])
0e1dc3e7
C
440 })
441
442 it('Should have a correct config on a server with registration enabled', async function () {
89d241a7 443 const data = await server.config.getConfig()
0e1dc3e7
C
444
445 expect(data.signup.allowed).to.be.true
446 })
447
448 it('Should have a correct config on a server with registration enabled and a users limit', async function () {
652b3056
C
449 this.timeout(5000)
450
47e0652b 451 await Promise.all([
89d241a7
C
452 server.users.register({ username: 'user1' }),
453 server.users.register({ username: 'user2' }),
454 server.users.register({ username: 'user3' })
47e0652b 455 ])
0e1dc3e7 456
89d241a7 457 const data = await server.config.getConfig()
0e1dc3e7
C
458
459 expect(data.signup.allowed).to.be.false
460 })
461
14e2014a 462 it('Should have the correct video allowed extensions', async function () {
89d241a7 463 const data = await server.config.getConfig()
14e2014a
C
464
465 expect(data.video.file.extensions).to.have.lengthOf(3)
466 expect(data.video.file.extensions).to.contain('.mp4')
467 expect(data.video.file.extensions).to.contain('.webm')
468 expect(data.video.file.extensions).to.contain('.ogv')
a4101923 469
89d241a7
C
470 await server.videos.upload({ attributes: { fixture: 'video_short.mkv' }, expectedStatus: HttpStatusCode.UNSUPPORTED_MEDIA_TYPE_415 })
471 await server.videos.upload({ attributes: { fixture: 'sample.ogg' }, expectedStatus: HttpStatusCode.UNSUPPORTED_MEDIA_TYPE_415 })
b345a804 472
a4101923 473 expect(data.contactForm.enabled).to.be.true
14e2014a
C
474 })
475
fd206f0b 476 it('Should get the customized configuration', async function () {
89d241a7 477 const data = await server.config.getCustomConfig()
fd206f0b 478
48f07b4a 479 checkInitialConfig(server, data)
fd206f0b
C
480 })
481
482 it('Should update the customized configuration', async function () {
89d241a7 483 await server.config.updateCustomConfig({ newCustomConfig })
fd206f0b 484
89d241a7 485 const data = await server.config.getCustomConfig()
40e87e9e 486 checkUpdatedConfig(data)
fd206f0b
C
487 })
488
14e2014a 489 it('Should have the correct updated video allowed extensions', async function () {
30bc55c8
C
490 this.timeout(10000)
491
89d241a7 492 const data = await server.config.getConfig()
14e2014a 493
30bc55c8 494 expect(data.video.file.extensions).to.have.length.above(4)
14e2014a
C
495 expect(data.video.file.extensions).to.contain('.mp4')
496 expect(data.video.file.extensions).to.contain('.webm')
497 expect(data.video.file.extensions).to.contain('.ogv')
498 expect(data.video.file.extensions).to.contain('.flv')
fccbbc1a 499 expect(data.video.file.extensions).to.contain('.wmv')
14e2014a 500 expect(data.video.file.extensions).to.contain('.mkv')
b345a804
C
501 expect(data.video.file.extensions).to.contain('.mp3')
502 expect(data.video.file.extensions).to.contain('.ogg')
503 expect(data.video.file.extensions).to.contain('.flac')
504
89d241a7
C
505 await server.videos.upload({ attributes: { fixture: 'video_short.mkv' }, expectedStatus: HttpStatusCode.OK_200 })
506 await server.videos.upload({ attributes: { fixture: 'sample.ogg' }, expectedStatus: HttpStatusCode.OK_200 })
14e2014a
C
507 })
508
fd206f0b 509 it('Should have the configuration updated after a restart', async function () {
61e9908c 510 this.timeout(30000)
23e27dd5 511
9293139f 512 await killallServers([ server ])
fd206f0b 513
254d3579 514 await server.run()
fd206f0b 515
89d241a7 516 const data = await server.config.getCustomConfig()
fd206f0b 517
40e87e9e 518 checkUpdatedConfig(data)
fd206f0b
C
519 })
520
36f9424f 521 it('Should fetch the about information', async function () {
89d241a7 522 const data = await server.config.getAbout()
36f9424f
C
523
524 expect(data.instance.name).to.equal('PeerTube updated')
2e3a0215 525 expect(data.instance.shortDescription).to.equal('my short description')
36f9424f
C
526 expect(data.instance.description).to.equal('my super description')
527 expect(data.instance.terms).to.equal('my super terms')
be04c6fd
C
528 expect(data.instance.codeOfConduct).to.equal('my super coc')
529
530 expect(data.instance.creationReason).to.equal('my super creation reason')
531 expect(data.instance.moderationInformation).to.equal('my super moderation information')
532 expect(data.instance.administrator).to.equal('Kuja')
533 expect(data.instance.maintenanceLifetime).to.equal('forever')
534 expect(data.instance.businessModel).to.equal('my super business model')
535 expect(data.instance.hardwareInformation).to.equal('2vCore 3GB RAM')
536
537 expect(data.instance.languages).to.deep.equal([ 'en', 'es' ])
538 expect(data.instance.categories).to.deep.equal([ 1, 2 ])
36f9424f
C
539 })
540
fd206f0b 541 it('Should remove the custom configuration', async function () {
23e27dd5
C
542 this.timeout(10000)
543
89d241a7 544 await server.config.deleteCustomConfig()
fd206f0b 545
89d241a7 546 const data = await server.config.getCustomConfig()
48f07b4a 547 checkInitialConfig(server, data)
fd206f0b
C
548 })
549
8155db66
C
550 it('Should enable frameguard', async function () {
551 this.timeout(25000)
552
553 {
554 const res = await makeGetRequest({
555 url: server.url,
556 path: '/api/v1/config',
c0e8b12e 557 expectedStatus: 200
8155db66
C
558 })
559
560 expect(res.headers['x-frame-options']).to.exist
561 }
562
9293139f 563 await killallServers([ server ])
8155db66
C
564
565 const config = {
566 security: {
567 frameguard: { enabled: false }
568 }
569 }
254d3579 570 await server.run(config)
8155db66
C
571
572 {
573 const res = await makeGetRequest({
574 url: server.url,
575 path: '/api/v1/config',
c0e8b12e 576 expectedStatus: 200
8155db66
C
577 })
578
579 expect(res.headers['x-frame-options']).to.not.exist
580 }
581 })
582
7c3b7976
C
583 after(async function () {
584 await cleanupTests([ server ])
0e1dc3e7
C
585 })
586})