aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/plugins.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-29 09:04:42 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-05-04 16:21:39 +0200
commit9107d791e2eef9a1b24b0499dac8b9dbba8a792f (patch)
treef09b20f06008b094f3266b39063bc9785dfebf5f /server/tests/api/check-params/plugins.ts
parent4a8d113b9b57d97ff13ad1608798eabca99643e4 (diff)
downloadPeerTube-9107d791e2eef9a1b24b0499dac8b9dbba8a792f.tar.gz
PeerTube-9107d791e2eef9a1b24b0499dac8b9dbba8a792f.tar.zst
PeerTube-9107d791e2eef9a1b24b0499dac8b9dbba8a792f.zip
Add external login tests
Diffstat (limited to 'server/tests/api/check-params/plugins.ts')
-rw-r--r--server/tests/api/check-params/plugins.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/server/tests/api/check-params/plugins.ts b/server/tests/api/check-params/plugins.ts
index cf80b35c2..07ded26ee 100644
--- a/server/tests/api/check-params/plugins.ts
+++ b/server/tests/api/check-params/plugins.ts
@@ -64,6 +64,7 @@ describe('Test server plugins API validators', function () {
64 describe('With static plugin routes', function () { 64 describe('With static plugin routes', function () {
65 it('Should fail with an unknown plugin name/plugin version', async function () { 65 it('Should fail with an unknown plugin name/plugin version', async function () {
66 const paths = [ 66 const paths = [
67 '/plugins/' + pluginName + '/0.0.1/auth/fake-auth',
67 '/plugins/' + pluginName + '/0.0.1/static/images/chocobo.png', 68 '/plugins/' + pluginName + '/0.0.1/static/images/chocobo.png',
68 '/plugins/' + pluginName + '/0.0.1/client-scripts/client/common-client-plugin.js', 69 '/plugins/' + pluginName + '/0.0.1/client-scripts/client/common-client-plugin.js',
69 '/themes/' + themeName + '/0.0.1/static/images/chocobo.png', 70 '/themes/' + themeName + '/0.0.1/static/images/chocobo.png',
@@ -86,6 +87,7 @@ describe('Test server plugins API validators', function () {
86 87
87 it('Should fail with invalid versions', async function () { 88 it('Should fail with invalid versions', async function () {
88 const paths = [ 89 const paths = [
90 '/plugins/' + pluginName + '/0.0.1.1/auth/fake-auth',
89 '/plugins/' + pluginName + '/0.0.1.1/static/images/chocobo.png', 91 '/plugins/' + pluginName + '/0.0.1.1/static/images/chocobo.png',
90 '/plugins/' + pluginName + '/0.1/client-scripts/client/common-client-plugin.js', 92 '/plugins/' + pluginName + '/0.1/client-scripts/client/common-client-plugin.js',
91 '/themes/' + themeName + '/1/static/images/chocobo.png', 93 '/themes/' + themeName + '/1/static/images/chocobo.png',
@@ -112,6 +114,12 @@ describe('Test server plugins API validators', function () {
112 } 114 }
113 }) 115 })
114 116
117 it('Should fail with an unknown auth name', async function () {
118 const path = '/plugins/' + pluginName + '/' + npmVersion + '/auth/bad-auth'
119
120 await makeGetRequest({ url: server.url, path, statusCodeExpected: 404 })
121 })
122
115 it('Should fail with an unknown static file', async function () { 123 it('Should fail with an unknown static file', async function () {
116 const paths = [ 124 const paths = [
117 '/plugins/' + pluginName + '/' + npmVersion + '/static/fake/chocobo.png', 125 '/plugins/' + pluginName + '/' + npmVersion + '/static/fake/chocobo.png',
@@ -145,6 +153,9 @@ describe('Test server plugins API validators', function () {
145 for (const p of paths) { 153 for (const p of paths) {
146 await makeGetRequest({ url: server.url, path: p, statusCodeExpected: 200 }) 154 await makeGetRequest({ url: server.url, path: p, statusCodeExpected: 200 })
147 } 155 }
156
157 const authPath = '/plugins/' + pluginName + '/' + npmVersion + '/auth/fake-auth'
158 await makeGetRequest({ url: server.url, path: authPath, statusCodeExpected: 302 })
148 }) 159 })
149 }) 160 })
150 161
@@ -462,6 +473,8 @@ describe('Test server plugins API validators', function () {
462 }) 473 })
463 474
464 it('Should succeed with the correct parameters', async function () { 475 it('Should succeed with the correct parameters', async function () {
476 this.timeout(10000)
477
465 const it = [ 478 const it = [
466 { suffix: 'install', status: 200 }, 479 { suffix: 'install', status: 200 },
467 { suffix: 'update', status: 200 }, 480 { suffix: 'update', status: 200 },