aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/services.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-12-09 11:14:47 +0100
committerChocobozzz <me@florianbigard.com>2022-12-12 13:36:23 +0100
commit2732eeff9e6994582293b5aaa0cb158b7e272e9e (patch)
tree417d30cf470cd1db84e06c5dbd1b5429d4b99bc1 /server/tests/api/check-params/services.ts
parentc7c5f8d0f17b0ab598fbe237f11639c6de28110c (diff)
downloadPeerTube-2732eeff9e6994582293b5aaa0cb158b7e272e9e.tar.gz
PeerTube-2732eeff9e6994582293b5aaa0cb158b7e272e9e.tar.zst
PeerTube-2732eeff9e6994582293b5aaa0cb158b7e272e9e.zip
Fix CI using 127.0.0.1 for tests
Diffstat (limited to 'server/tests/api/check-params/services.ts')
-rw-r--r--server/tests/api/check-params/services.ts30
1 files changed, 15 insertions, 15 deletions
diff --git a/server/tests/api/check-params/services.ts b/server/tests/api/check-params/services.ts
index 0da675902..d45868f36 100644
--- a/server/tests/api/check-params/services.ts
+++ b/server/tests/api/check-params/services.ts
@@ -76,87 +76,87 @@ describe('Test services API validators', function () {
76 }) 76 })
77 77
78 it('Should fail with an invalid element id', async function () { 78 it('Should fail with an invalid element id', async function () {
79 const embedUrl = `http://localhost:${server.port}/videos/watch/blabla` 79 const embedUrl = `${server.url}/videos/watch/blabla`
80 await checkParamEmbed(server, embedUrl) 80 await checkParamEmbed(server, embedUrl)
81 }) 81 })
82 82
83 it('Should fail with an unknown element', async function () { 83 it('Should fail with an unknown element', async function () {
84 const embedUrl = `http://localhost:${server.port}/videos/watch/88fc0165-d1f0-4a35-a51a-3b47f668689c` 84 const embedUrl = `${server.url}/videos/watch/88fc0165-d1f0-4a35-a51a-3b47f668689c`
85 await checkParamEmbed(server, embedUrl, HttpStatusCode.NOT_FOUND_404) 85 await checkParamEmbed(server, embedUrl, HttpStatusCode.NOT_FOUND_404)
86 }) 86 })
87 87
88 it('Should fail with an invalid path', async function () { 88 it('Should fail with an invalid path', async function () {
89 const embedUrl = `http://localhost:${server.port}/videos/watchs/${server.store.videoCreated.uuid}` 89 const embedUrl = `${server.url}/videos/watchs/${server.store.videoCreated.uuid}`
90 90
91 await checkParamEmbed(server, embedUrl) 91 await checkParamEmbed(server, embedUrl)
92 }) 92 })
93 93
94 it('Should fail with an invalid max height', async function () { 94 it('Should fail with an invalid max height', async function () {
95 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}` 95 const embedUrl = `${server.url}/videos/watch/${server.store.videoCreated.uuid}`
96 96
97 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxheight: 'hello' }) 97 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxheight: 'hello' })
98 }) 98 })
99 99
100 it('Should fail with an invalid max width', async function () { 100 it('Should fail with an invalid max width', async function () {
101 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}` 101 const embedUrl = `${server.url}/videos/watch/${server.store.videoCreated.uuid}`
102 102
103 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxwidth: 'hello' }) 103 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { maxwidth: 'hello' })
104 }) 104 })
105 105
106 it('Should fail with an invalid format', async function () { 106 it('Should fail with an invalid format', async function () {
107 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}` 107 const embedUrl = `${server.url}/videos/watch/${server.store.videoCreated.uuid}`
108 108
109 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { format: 'blabla' }) 109 await checkParamEmbed(server, embedUrl, HttpStatusCode.BAD_REQUEST_400, { format: 'blabla' })
110 }) 110 })
111 111
112 it('Should fail with a non supported format', async function () { 112 it('Should fail with a non supported format', async function () {
113 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}` 113 const embedUrl = `${server.url}/videos/watch/${server.store.videoCreated.uuid}`
114 114
115 await checkParamEmbed(server, embedUrl, HttpStatusCode.NOT_IMPLEMENTED_501, { format: 'xml' }) 115 await checkParamEmbed(server, embedUrl, HttpStatusCode.NOT_IMPLEMENTED_501, { format: 'xml' })
116 }) 116 })
117 117
118 it('Should fail with a private video', async function () { 118 it('Should fail with a private video', async function () {
119 const embedUrl = `http://localhost:${server.port}/videos/watch/${privateVideo.uuid}` 119 const embedUrl = `${server.url}/videos/watch/${privateVideo.uuid}`
120 120
121 await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403) 121 await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403)
122 }) 122 })
123 123
124 it('Should fail with an unlisted video with the int id', async function () { 124 it('Should fail with an unlisted video with the int id', async function () {
125 const embedUrl = `http://localhost:${server.port}/videos/watch/${unlistedVideo.id}` 125 const embedUrl = `${server.url}/videos/watch/${unlistedVideo.id}`
126 126
127 await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403) 127 await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403)
128 }) 128 })
129 129
130 it('Should succeed with an unlisted video using the uuid id', async function () { 130 it('Should succeed with an unlisted video using the uuid id', async function () {
131 for (const uuid of [ unlistedVideo.uuid, unlistedVideo.shortUUID ]) { 131 for (const uuid of [ unlistedVideo.uuid, unlistedVideo.shortUUID ]) {
132 const embedUrl = `http://localhost:${server.port}/videos/watch/${uuid}` 132 const embedUrl = `${server.url}/videos/watch/${uuid}`
133 133
134 await checkParamEmbed(server, embedUrl, HttpStatusCode.OK_200) 134 await checkParamEmbed(server, embedUrl, HttpStatusCode.OK_200)
135 } 135 }
136 }) 136 })
137 137
138 it('Should fail with a private playlist', async function () { 138 it('Should fail with a private playlist', async function () {
139 const embedUrl = `http://localhost:${server.port}/videos/watch/playlist/${privatePlaylist.uuid}` 139 const embedUrl = `${server.url}/videos/watch/playlist/${privatePlaylist.uuid}`
140 140
141 await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403) 141 await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403)
142 }) 142 })
143 143
144 it('Should fail with an unlisted playlist using the int id', async function () { 144 it('Should fail with an unlisted playlist using the int id', async function () {
145 const embedUrl = `http://localhost:${server.port}/videos/watch/playlist/${unlistedPlaylist.id}` 145 const embedUrl = `${server.url}/videos/watch/playlist/${unlistedPlaylist.id}`
146 146
147 await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403) 147 await checkParamEmbed(server, embedUrl, HttpStatusCode.FORBIDDEN_403)
148 }) 148 })
149 149
150 it('Should succeed with an unlisted playlist using the uuid id', async function () { 150 it('Should succeed with an unlisted playlist using the uuid id', async function () {
151 for (const uuid of [ unlistedPlaylist.uuid, unlistedPlaylist.shortUUID ]) { 151 for (const uuid of [ unlistedPlaylist.uuid, unlistedPlaylist.shortUUID ]) {
152 const embedUrl = `http://localhost:${server.port}/videos/watch/playlist/${uuid}` 152 const embedUrl = `${server.url}/videos/watch/playlist/${uuid}`
153 153
154 await checkParamEmbed(server, embedUrl, HttpStatusCode.OK_200) 154 await checkParamEmbed(server, embedUrl, HttpStatusCode.OK_200)
155 } 155 }
156 }) 156 })
157 157
158 it('Should succeed with the correct params with a video', async function () { 158 it('Should succeed with the correct params with a video', async function () {
159 const embedUrl = `http://localhost:${server.port}/videos/watch/${server.store.videoCreated.uuid}` 159 const embedUrl = `${server.url}/videos/watch/${server.store.videoCreated.uuid}`
160 const query = { 160 const query = {
161 format: 'json', 161 format: 'json',
162 maxheight: 400, 162 maxheight: 400,
@@ -167,7 +167,7 @@ describe('Test services API validators', function () {
167 }) 167 })
168 168
169 it('Should succeed with the correct params with a playlist', async function () { 169 it('Should succeed with the correct params with a playlist', async function () {
170 const embedUrl = `http://localhost:${server.port}/videos/watch/playlist/${playlistUUID}` 170 const embedUrl = `${server.url}/videos/watch/playlist/${playlistUUID}`
171 const query = { 171 const query = {
172 format: 'json', 172 format: 'json',
173 maxheight: 400, 173 maxheight: 400,