diff options
Diffstat (limited to 'shared/extra-utils/server/plugins.ts')
-rw-r--r-- | shared/extra-utils/server/plugins.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/shared/extra-utils/server/plugins.ts b/shared/extra-utils/server/plugins.ts index 8f370f655..83db2f6b8 100644 --- a/shared/extra-utils/server/plugins.ts +++ b/shared/extra-utils/server/plugins.ts | |||
@@ -1,5 +1,9 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | ||
2 | |||
3 | import { expect } from 'chai' | ||
1 | import { readJSON, writeJSON } from 'fs-extra' | 4 | import { readJSON, writeJSON } from 'fs-extra' |
2 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { RegisteredServerSettings } from '@shared/models' | ||
3 | import { PeertubePluginIndexList } from '../../models/plugins/peertube-plugin-index-list.model' | 7 | import { PeertubePluginIndexList } from '../../models/plugins/peertube-plugin-index-list.model' |
4 | import { PluginType } from '../../models/plugins/plugin.type' | 8 | import { PluginType } from '../../models/plugins/plugin.type' |
5 | import { buildServerDirectory, root } from '../miscs/miscs' | 9 | import { buildServerDirectory, root } from '../miscs/miscs' |
@@ -119,6 +123,21 @@ function getPluginRegisteredSettings (parameters: { | |||
119 | }) | 123 | }) |
120 | } | 124 | } |
121 | 125 | ||
126 | async function testHelloWorldRegisteredSettings (server: ServerInfo) { | ||
127 | const res = await getPluginRegisteredSettings({ | ||
128 | url: server.url, | ||
129 | accessToken: server.accessToken, | ||
130 | npmName: 'peertube-plugin-hello-world' | ||
131 | }) | ||
132 | |||
133 | const registeredSettings = (res.body as RegisteredServerSettings).registeredSettings | ||
134 | |||
135 | expect(registeredSettings).to.have.length.at.least(1) | ||
136 | |||
137 | const adminNameSettings = registeredSettings.find(s => s.name === 'admin-name') | ||
138 | expect(adminNameSettings).to.not.be.undefined | ||
139 | } | ||
140 | |||
122 | function getPublicSettings (parameters: { | 141 | function getPublicSettings (parameters: { |
123 | url: string | 142 | url: string |
124 | npmName: string | 143 | npmName: string |
@@ -265,6 +284,7 @@ export { | |||
265 | updatePlugin, | 284 | updatePlugin, |
266 | getPlugin, | 285 | getPlugin, |
267 | uninstallPlugin, | 286 | uninstallPlugin, |
287 | testHelloWorldRegisteredSettings, | ||
268 | updatePluginSettings, | 288 | updatePluginSettings, |
269 | getPluginRegisteredSettings, | 289 | getPluginRegisteredSettings, |
270 | getPackageJSONPath, | 290 | getPackageJSONPath, |