X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fcheck-params%2Fplugins.ts;h=9553bce17f466d2c06635b56820ed8b2a6f9f9ad;hb=bfbd912886eba17b4aa9a40dcef2fddc685d85bf;hp=dd03766c963208dd90ae4fea8f756a3778f1ac2e;hpb=60cfd4cb54138e7da76054aa163b33b3223b17ef;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/check-params/plugins.ts b/server/tests/api/check-params/plugins.ts index dd03766c9..9553bce17 100644 --- a/server/tests/api/check-params/plugins.ts +++ b/server/tests/api/check-params/plugins.ts @@ -152,7 +152,8 @@ describe('Test server plugins API validators', function () { const path = '/api/v1/plugins/available' const baseQuery = { search: 'super search', - pluginType: PluginType.PLUGIN + pluginType: PluginType.PLUGIN, + currentPeerTubeEngine: '1.2.3' } it('Should fail with an invalid token', async function () { @@ -198,6 +199,17 @@ describe('Test server plugins API validators', function () { }) }) + it('Should fail with an invalid current peertube engine', async function () { + const query = immutableAssign(baseQuery, { currentPeerTubeEngine: '1.0' }) + + await makeGetRequest({ + url: server.url, + path, + token: server.accessToken, + query + }) + }) + it('Should success with the correct parameters', async function () { await makeGetRequest({ url: server.url, @@ -269,7 +281,7 @@ describe('Test server plugins API validators', function () { }) }) - describe('When getting a plugin or the registered settings', function () { + describe('When getting a plugin or the registered settings or public settings', function () { const path = '/api/v1/plugins/' it('Should fail with an invalid token', async function () { @@ -295,7 +307,7 @@ describe('Test server plugins API validators', function () { }) it('Should fail with an invalid npm name', async function () { - for (const suffix of [ 'toto', 'toto/registered-settings' ]) { + for (const suffix of [ 'toto', 'toto/registered-settings', 'toto/public-settings' ]) { await makeGetRequest({ url: server.url, path: path + suffix, @@ -304,7 +316,7 @@ describe('Test server plugins API validators', function () { }) } - for (const suffix of [ 'peertube-plugin-TOTO', 'peertube-plugin-TOTO/registered-settings' ]) { + for (const suffix of [ 'peertube-plugin-TOTO', 'peertube-plugin-TOTO/registered-settings', 'peertube-plugin-TOTO/public-settings' ]) { await makeGetRequest({ url: server.url, path: path + suffix, @@ -315,7 +327,7 @@ describe('Test server plugins API validators', function () { }) it('Should fail with an unknown plugin', async function () { - for (const suffix of [ 'peertube-plugin-toto', 'peertube-plugin-toto/registered-settings' ]) { + for (const suffix of [ 'peertube-plugin-toto', 'peertube-plugin-toto/registered-settings', 'peertube-plugin-toto/public-settings' ]) { await makeGetRequest({ url: server.url, path: path + suffix, @@ -326,7 +338,7 @@ describe('Test server plugins API validators', function () { }) it('Should succeed with the correct parameters', async function () { - for (const suffix of [ npmPlugin, `${npmPlugin}/registered-settings` ]) { + for (const suffix of [ npmPlugin, `${npmPlugin}/registered-settings`, `${npmPlugin}/public-settings` ]) { await makeGetRequest({ url: server.url, path: path + suffix,