X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fplugins%2Fplugin-router.ts;h=81e18dabd71872834d91b7a2f4a3ca62ddcec739;hb=04aed76711909507e74905bde3a7fa024d3585c9;hp=5392acc51a7b8b5f0a172e98ebd1595be6d14c4f;hpb=f17faefb30e4872688a1c0dafcc6c793242750f4;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/plugins/plugin-router.ts b/server/tests/plugins/plugin-router.ts index 5392acc51..81e18dabd 100644 --- a/server/tests/plugins/plugin-router.ts +++ b/server/tests/plugins/plugin-router.ts @@ -1,16 +1,17 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' -import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../shared/extra-utils/server/servers' +import { expect } from 'chai' +import { HttpStatusCode } from '@shared/core-utils' import { - getPluginTestPath, - installPlugin, + cleanupTests, + flushAndRunServer, makeGetRequest, makePostBodyRequest, - setAccessTokensToServers, uninstallPlugin -} from '../../../shared/extra-utils' -import { expect } from 'chai' -import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' + PluginsCommand, + ServerInfo, + setAccessTokensToServers +} from '@shared/extra-utils' describe('Test plugin helpers', function () { let server: ServerInfo @@ -25,11 +26,7 @@ describe('Test plugin helpers', function () { server = await flushAndRunServer(1) await setAccessTokensToServers([ server ]) - await installPlugin({ - url: server.url, - accessToken: server.accessToken, - path: getPluginTestPath('-five') - }) + await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-five') }) }) it('Should answer "pong"', async function () { @@ -53,7 +50,7 @@ describe('Test plugin helpers', function () { statusCodeExpected: 200 }) - expect(res.body.isAuthenticated).to.equal(undefined) + expect(res.body.isAuthenticated).to.equal(true) const secRes = await makeGetRequest({ url: server.url, @@ -85,11 +82,7 @@ describe('Test plugin helpers', function () { }) it('Should remove the plugin and remove the routes', async function () { - await uninstallPlugin({ - url: server.url, - accessToken: server.accessToken, - npmName: 'peertube-plugin-test-five' - }) + await server.pluginsCommand.uninstall({ npmName: 'peertube-plugin-test-five' }) for (const path of basePaths) { await makeGetRequest({