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.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.ts
index f86712b4e..83435c24a 100644
--- a/server/tests/api/check-params/services.ts
+++ b/server/tests/api/check-params/services.ts
@@ -25,14 +25,14 @@ describe('Test services API validators', function () {
25 await setAccessTokensToServers([ server ]) 25 await setAccessTokensToServers([ server ])
26 await setDefaultVideoChannel([ server ]) 26 await setDefaultVideoChannel([ server ])
27 27
28 server.video = await server.videosCommand.upload({ attributes: { name: 'my super name' } }) 28 server.store.video = await server.videos.upload({ attributes: { name: 'my super name' } })
29 29
30 { 30 {
31 const created = await server.playlistsCommand.create({ 31 const created = await server.playlists.create({
32 attributes: { 32 attributes: {
33 displayName: 'super playlist', 33 displayName: 'super playlist',
34 privacy: VideoPlaylistPrivacy.PUBLIC, 34 privacy: VideoPlaylistPrivacy.PUBLIC,
35 videoChannelId: server.videoChannel.id 35 videoChannelId: server.store.channel.id
36 } 36 }
37 }) 37 })
38 38
@@ -48,7 +48,7 @@ describe('Test services API validators', function () {
48 }) 48 })
49 49
50 it('Should fail with an invalid host', async function () { 50 it('Should fail with an invalid host', async function () {
51 const embedUrl = 'http://hello.com/videos/watch/' + server.video.uuid 51 const embedUrl = 'http://hello.com/videos/watch/' + server.store.video.uuid
52 await checkParamEmbed(server, embedUrl) 52 await checkParamEmbed(server, embedUrl)
53 }) 53 })
54 54
@@ -63,37 +63,37 @@ describe('Test services API validators', function () {
63 }) 63 })
64 64
65 it('Should fail with an invalid path', async function () { 65 it('Should fail with an invalid path', async function () {
66 const embedUrl = `http://localhost:${server.port}/videos/watchs/${server.video.uuid}` 66 const embedUrl = `http://localhost:${server.port}/videos/watchs/${server.store.video.uuid}`
67 67
68 await checkParamEmbed(server, embedUrl) 68 await checkParamEmbed(server, embedUrl)
69 }) 69 })
70 70
71 it('Should fail with an invalid max height', async function () { 71 it('Should fail with an invalid max height', async function () {
72 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.video.uuid}` 72 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.video.uuid}`
73 73
74 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxheight: 'hello' }) 74 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxheight: 'hello' })
75 }) 75 })
76 76
77 it('Should fail with an invalid max width', async function () { 77 it('Should fail with an invalid max width', async function () {
78 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.video.uuid}` 78 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.video.uuid}`
79 79
80 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxwidth: 'hello' }) 80 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxwidth: 'hello' })
81 }) 81 })
82 82
83 it('Should fail with an invalid format', async function () { 83 it('Should fail with an invalid format', async function () {
84 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.video.uuid}` 84 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.video.uuid}`
85 85
86 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { format: 'blabla' }) 86 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { format: 'blabla' })
87 }) 87 })
88 88
89 it('Should fail with a non supported format', async function () { 89 it('Should fail with a non supported format', async function () {
90 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.video.uuid}` 90 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.video.uuid}`
91 91
92 await checkParamEmbed(server, embedUrl, HttpStatusCode.NOT_IMPLEMENTED_501, { format: 'xml' }) 92 await checkParamEmbed(server, embedUrl, HttpStatusCode.NOT_IMPLEMENTED_501, { format: 'xml' })
93 }) 93 })
94 94
95 it('Should succeed with the correct params with a video', async function () { 95 it('Should succeed with the correct params with a video', async function () {
96 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.video.uuid}` 96 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.video.uuid}`
97 const query = { 97 const query = {
98 format: 'json', 98 format: 'json',
99 maxheight: 400, 99 maxheight: 400,