-/* tslint:disable:no-unused-expression */
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
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 () {
})
})
+ 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,
})
})
- 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 () {
})
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,
})
}
- 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,
})
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,
})
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,