Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Merge branch 'next' into develop

Chocobozzza24bd1ed41b4
diff --cc server/tests/plugins/video-constants.ts
index 7b1312f88f,f527a2b301..19cba6c2c8
--- a/server/tests/plugins/video-constants.ts
+++ b/server/tests/plugins/video-constants.ts
@@@ -1,25 -1,9 +1,16 @@@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
- import * as chai from 'chai'
import 'mocha'
- import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../shared/extra-utils/server/servers'
+ import * as chai from 'chai'
-import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers } from '@shared/extra-utils'
+import {
- createVideoPlaylist,
- getPluginTestPath,
- getVideo,
- getVideoCategories,
- getVideoLanguages,
- getVideoLicences,
- getVideoPlaylistPrivacies,
- getVideoPrivacies,
- installPlugin,
++ cleanupTests,
++ createSingleServer,
+ makeGetRequest,
- setAccessTokensToServers,
- uninstallPlugin,
- uploadVideo
- } from '../../../shared/extra-utils'
- import { VideoDetails, VideoPlaylistPrivacy } from '../../../shared/models/videos'
- import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
++ PeerTubeServer,
++ PluginsCommand,
++ setAccessTokensToServers
++} from '@shared/extra-utils'
+ import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'
const expect = chai.expect
@@@ -176,38 -139,6 +146,37 @@@ describe('Test plugin altering video co
}
})
+ it('Should be able to reset categories', async function () {
- await installPlugin({
- url: server.url,
- accessToken: server.accessToken,
- path: getPluginTestPath('-video-constants')
- })
++ await server.plugins.install({ path: PluginsCommand.getPluginTestPath('-video-constants') })
+
- let { body: categories } = await getVideoCategories(server.url)
++ {
++ const categories = await server.videos.getCategories()
+
- expect(categories[1]).to.not.exist
- expect(categories[2]).to.not.exist
++ expect(categories[1]).to.not.exist
++ expect(categories[2]).to.not.exist
+
- expect(categories[42]).to.exist
- expect(categories[43]).to.exist
++ expect(categories[42]).to.exist
++ expect(categories[43]).to.exist
++ }
+
+ await makeGetRequest({
+ url: server.url,
+ token: server.accessToken,
+ path: '/plugins/test-video-constants/router/reset-categories',
- statusCodeExpected: HttpStatusCode.NO_CONTENT_204
++ expectedStatus: HttpStatusCode.NO_CONTENT_204
+ })
+
- const { body } = await getVideoCategories(server.url)
- categories = body
++ {
++ const categories = await server.videos.getCategories()
+
- expect(categories[1]).to.exist
- expect(categories[2]).to.exist
++ expect(categories[1]).to.exist
++ expect(categories[2]).to.exist
+
- expect(categories[42]).to.not.exist
- expect(categories[43]).to.not.exist
++ expect(categories[42]).to.not.exist
++ expect(categories[43]).to.not.exist
++ }
+ })
+
after(async function () {
await cleanupTests([ server ])
})