aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/plugins')
-rw-r--r--server/tests/plugins/action-hooks.ts2
-rw-r--r--server/tests/plugins/external-auth.ts7
-rw-r--r--server/tests/plugins/filter-hooks.ts3
-rw-r--r--server/tests/plugins/html-injection.ts2
-rw-r--r--server/tests/plugins/id-and-pass-auth.ts5
-rw-r--r--server/tests/plugins/plugin-helpers.ts6
-rw-r--r--server/tests/plugins/plugin-router.ts4
-rw-r--r--server/tests/plugins/plugin-storage.ts2
-rw-r--r--server/tests/plugins/plugin-transcoding.ts2
-rw-r--r--server/tests/plugins/plugin-unloading.ts2
-rw-r--r--server/tests/plugins/video-constants.ts5
11 files changed, 18 insertions, 22 deletions
diff --git a/server/tests/plugins/action-hooks.ts b/server/tests/plugins/action-hooks.ts
index b96de4e90..4c1bc7d06 100644
--- a/server/tests/plugins/action-hooks.ts
+++ b/server/tests/plugins/action-hooks.ts
@@ -120,7 +120,7 @@ describe('Test plugin action hooks', function () {
120 }) 120 })
121 121
122 it('Should run action:api.user.oauth2-got-token', async function () { 122 it('Should run action:api.user.oauth2-got-token', async function () {
123 await servers[0].login.getAccessToken('created_user', 'super_password') 123 await servers[0].login.login({ user: { username: 'created_user' } })
124 124
125 await checkHook('action:api.user.oauth2-got-token') 125 await checkHook('action:api.user.oauth2-got-token')
126 }) 126 })
diff --git a/server/tests/plugins/external-auth.ts b/server/tests/plugins/external-auth.ts
index a2828603a..f3e018d43 100644
--- a/server/tests/plugins/external-auth.ts
+++ b/server/tests/plugins/external-auth.ts
@@ -2,17 +2,16 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 decodeQueryString,
9 createSingleServer, 7 createSingleServer,
10 PluginsCommand, 8 decodeQueryString,
11 PeerTubeServer, 9 PeerTubeServer,
10 PluginsCommand,
12 setAccessTokensToServers, 11 setAccessTokensToServers,
13 wait 12 wait
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
15import { UserRole } from '@shared/models' 14import { HttpStatusCode, UserRole } from '@shared/models'
16 15
17async function loginExternal (options: { 16async function loginExternal (options: {
18 server: PeerTubeServer 17 server: PeerTubeServer
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts
index ba84dd27a..c00ac8f91 100644
--- a/server/tests/plugins/filter-hooks.ts
+++ b/server/tests/plugins/filter-hooks.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createMultipleServers, 7 createMultipleServers,
@@ -15,7 +14,7 @@ import {
15 setDefaultVideoChannel, 14 setDefaultVideoChannel,
16 waitJobs 15 waitJobs
17} from '@shared/extra-utils' 16} from '@shared/extra-utils'
18import { VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' 17import { HttpStatusCode, VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
19 18
20const expect = chai.expect 19const expect = chai.expect
21 20
diff --git a/server/tests/plugins/html-injection.ts b/server/tests/plugins/html-injection.ts
index 2902c39b7..95c0cd687 100644
--- a/server/tests/plugins/html-injection.ts
+++ b/server/tests/plugins/html-injection.ts
@@ -6,8 +6,8 @@ import {
6 cleanupTests, 6 cleanupTests,
7 createSingleServer, 7 createSingleServer,
8 makeHTMLRequest, 8 makeHTMLRequest,
9 PluginsCommand,
10 PeerTubeServer, 9 PeerTubeServer,
10 PluginsCommand,
11 setAccessTokensToServers 11 setAccessTokensToServers
12} from '../../../shared/extra-utils' 12} from '../../../shared/extra-utils'
13 13
diff --git a/server/tests/plugins/id-and-pass-auth.ts b/server/tests/plugins/id-and-pass-auth.ts
index a73d76caa..fde0166f9 100644
--- a/server/tests/plugins/id-and-pass-auth.ts
+++ b/server/tests/plugins/id-and-pass-auth.ts
@@ -2,9 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models' 5import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers, wait } from '@shared/extra-utils'
6import { cleanupTests, createSingleServer, PluginsCommand, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/extra-utils' 6import { HttpStatusCode, UserRole } from '@shared/models'
7import { UserRole } from '@shared/models'
8 7
9describe('Test id and pass auth plugins', function () { 8describe('Test id and pass auth plugins', function () {
10 let server: PeerTubeServer 9 let server: PeerTubeServer
diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.ts
index 5cb664bda..242994273 100644
--- a/server/tests/plugins/plugin-helpers.ts
+++ b/server/tests/plugins/plugin-helpers.ts
@@ -2,19 +2,19 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 checkVideoFilesWereRemoved, 6 checkVideoFilesWereRemoved,
8 cleanupTests, 7 cleanupTests,
9 doubleFollow,
10 createMultipleServers, 8 createMultipleServers,
9 doubleFollow,
11 makeGetRequest, 10 makeGetRequest,
12 makePostBodyRequest, 11 makePostBodyRequest,
13 PluginsCommand,
14 PeerTubeServer, 12 PeerTubeServer,
13 PluginsCommand,
15 setAccessTokensToServers, 14 setAccessTokensToServers,
16 waitJobs 15 waitJobs
17} from '@shared/extra-utils' 16} from '@shared/extra-utils'
17import { HttpStatusCode } from '@shared/models'
18 18
19function postCommand (server: PeerTubeServer, command: string, bodyArg?: object) { 19function postCommand (server: PeerTubeServer, command: string, bodyArg?: object) {
20 const body = { command } 20 const body = { command }
diff --git a/server/tests/plugins/plugin-router.ts b/server/tests/plugins/plugin-router.ts
index becb7c47b..b1ac9e2fe 100644
--- a/server/tests/plugins/plugin-router.ts
+++ b/server/tests/plugins/plugin-router.ts
@@ -2,16 +2,16 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createSingleServer, 7 createSingleServer,
9 makeGetRequest, 8 makeGetRequest,
10 makePostBodyRequest, 9 makePostBodyRequest,
11 PluginsCommand,
12 PeerTubeServer, 10 PeerTubeServer,
11 PluginsCommand,
13 setAccessTokensToServers 12 setAccessTokensToServers
14} from '@shared/extra-utils' 13} from '@shared/extra-utils'
14import { HttpStatusCode } from '@shared/models'
15 15
16describe('Test plugin helpers', function () { 16describe('Test plugin helpers', function () {
17 let server: PeerTubeServer 17 let server: PeerTubeServer
diff --git a/server/tests/plugins/plugin-storage.ts b/server/tests/plugins/plugin-storage.ts
index 90dafa3e1..e20c36dba 100644
--- a/server/tests/plugins/plugin-storage.ts
+++ b/server/tests/plugins/plugin-storage.ts
@@ -4,7 +4,6 @@ import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { pathExists, readdir, readFile } from 'fs-extra' 5import { pathExists, readdir, readFile } from 'fs-extra'
6import { join } from 'path' 6import { join } from 'path'
7import { HttpStatusCode } from '@shared/models'
8import { 7import {
9 cleanupTests, 8 cleanupTests,
10 createSingleServer, 9 createSingleServer,
@@ -13,6 +12,7 @@ import {
13 PluginsCommand, 12 PluginsCommand,
14 setAccessTokensToServers 13 setAccessTokensToServers
15} from '@shared/extra-utils' 14} from '@shared/extra-utils'
15import { HttpStatusCode } from '@shared/models'
16 16
17describe('Test plugin storage', function () { 17describe('Test plugin storage', function () {
18 let server: PeerTubeServer 18 let server: PeerTubeServer
diff --git a/server/tests/plugins/plugin-transcoding.ts b/server/tests/plugins/plugin-transcoding.ts
index 3c54d3796..0bf1fab01 100644
--- a/server/tests/plugins/plugin-transcoding.ts
+++ b/server/tests/plugins/plugin-transcoding.ts
@@ -7,8 +7,8 @@ import { getAudioStream, getVideoFileFPS, getVideoStreamFromFile } from '@server
7import { 7import {
8 cleanupTests, 8 cleanupTests,
9 createSingleServer, 9 createSingleServer,
10 PluginsCommand,
11 PeerTubeServer, 10 PeerTubeServer,
11 PluginsCommand,
12 setAccessTokensToServers, 12 setAccessTokensToServers,
13 setDefaultVideoChannel, 13 setDefaultVideoChannel,
14 testFfmpegStreamError, 14 testFfmpegStreamError,
diff --git a/server/tests/plugins/plugin-unloading.ts b/server/tests/plugins/plugin-unloading.ts
index faf9cc599..6bf2fda9b 100644
--- a/server/tests/plugins/plugin-unloading.ts
+++ b/server/tests/plugins/plugin-unloading.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '@shared/models'
6import { 5import {
7 cleanupTests, 6 cleanupTests,
8 createSingleServer, 7 createSingleServer,
@@ -11,6 +10,7 @@ import {
11 PluginsCommand, 10 PluginsCommand,
12 setAccessTokensToServers 11 setAccessTokensToServers
13} from '@shared/extra-utils' 12} from '@shared/extra-utils'
13import { HttpStatusCode } from '@shared/models'
14 14
15describe('Test plugins module unloading', function () { 15describe('Test plugins module unloading', function () {
16 let server: PeerTubeServer = null 16 let server: PeerTubeServer = null
diff --git a/server/tests/plugins/video-constants.ts b/server/tests/plugins/video-constants.ts
index dd3b40225..f527a2b30 100644
--- a/server/tests/plugins/video-constants.ts
+++ b/server/tests/plugins/video-constants.ts
@@ -2,9 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { HttpStatusCode } from '@shared/models' 5import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers } from '@shared/extra-utils'
6import { cleanupTests, createSingleServer, PluginsCommand, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' 6import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models'
7import { VideoPlaylistPrivacy } from '@shared/models'
8 7
9const expect = chai.expect 8const expect = chai.expect
10 9