aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/services.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/services.ts')
-rw-r--r--server/tests/api/check-params/services.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.ts
index 4c4a5cade..8d795fabc 100644
--- a/server/tests/api/check-params/services.ts
+++ b/server/tests/api/check-params/services.ts
@@ -24,7 +24,7 @@ describe('Test services API validators', function () {
24 await setAccessTokensToServers([ server ]) 24 await setAccessTokensToServers([ server ])
25 await setDefaultVideoChannel([ server ]) 25 await setDefaultVideoChannel([ server ])
26 26
27 server.store.video = await server.videos.upload({ attributes: { name: 'my super name' } }) 27 server.store.videoCreated = await server.videos.upload({ attributes: { name: 'my super name' } })
28 28
29 { 29 {
30 const created = await server.playlists.create({ 30 const created = await server.playlists.create({
@@ -47,7 +47,7 @@ describe('Test services API validators', function () {
47 }) 47 })
48 48
49 it('Should fail with an invalid host', async function () { 49 it('Should fail with an invalid host', async function () {
50 const embedUrl = 'http://hello.com/videos/watch/' + server.store.video.uuid 50 const embedUrl = 'http://hello.com/videos/watch/' + server.store.videoCreated.uuid
51 await checkParamEmbed(server, embedUrl) 51 await checkParamEmbed(server, embedUrl)
52 }) 52 })
53 53
@@ -62,37 +62,37 @@ describe('Test services API validators', function () {
62 }) 62 })
63 63
64 it('Should fail with an invalid path', async function () { 64 it('Should fail with an invalid path', async function () {
65 const embedUrl = `http://localhost:${server.port}/videos/watchs/${server.store.video.uuid}` 65 const embedUrl = `http://localhost:${server.port}/videos/watchs/${server.store.videoCreated.uuid}`
66 66
67 await checkParamEmbed(server, embedUrl) 67 await checkParamEmbed(server, embedUrl)
68 }) 68 })
69 69
70 it('Should fail with an invalid max height', async function () { 70 it('Should fail with an invalid max height', async function () {
71 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.video.uuid}` 71 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}`
72 72
73 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxheight: 'hello' }) 73 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxheight: 'hello' })
74 }) 74 })
75 75
76 it('Should fail with an invalid max width', async function () { 76 it('Should fail with an invalid max width', async function () {
77 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.video.uuid}` 77 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}`
78 78
79 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxwidth: 'hello' }) 79 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxwidth: 'hello' })
80 }) 80 })
81 81
82 it('Should fail with an invalid format', async function () { 82 it('Should fail with an invalid format', async function () {
83 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.video.uuid}` 83 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}`
84 84
85 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { format: 'blabla' }) 85 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { format: 'blabla' })
86 }) 86 })
87 87
88 it('Should fail with a non supported format', async function () { 88 it('Should fail with a non supported format', async function () {
89 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.video.uuid}` 89 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}`
90 90
91 await checkParamEmbed(server, embedUrl, HttpStatusCode.NOT_IMPLEMENTED_501, { format: 'xml' }) 91 await checkParamEmbed(server, embedUrl, HttpStatusCode.NOT_IMPLEMENTED_501, { format: 'xml' })
92 }) 92 })
93 93
94 it('Should succeed with the correct params with a video', async function () { 94 it('Should succeed with the correct params with a video', async function () {
95 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.video.uuid}` 95 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}`
96 const query = { 96 const query = {
97 format: 'json', 97 format: 'json',
98 maxheight: 400, 98 maxheight: 400,