From 4c7e60bc17ee5830399bac4aa273356903421b4c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 14:27:30 +0200 Subject: Reorganize imports --- server/tests/plugins/action-hooks.ts | 2 +- server/tests/plugins/external-auth.ts | 7 +++---- server/tests/plugins/filter-hooks.ts | 3 +-- server/tests/plugins/html-injection.ts | 2 +- server/tests/plugins/id-and-pass-auth.ts | 5 ++--- server/tests/plugins/plugin-helpers.ts | 6 +++--- server/tests/plugins/plugin-router.ts | 4 ++-- server/tests/plugins/plugin-storage.ts | 2 +- server/tests/plugins/plugin-transcoding.ts | 2 +- server/tests/plugins/plugin-unloading.ts | 2 +- server/tests/plugins/video-constants.ts | 5 ++--- 11 files changed, 18 insertions(+), 22 deletions(-) (limited to 'server/tests/plugins') 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 () { }) it('Should run action:api.user.oauth2-got-token', async function () { - await servers[0].login.getAccessToken('created_user', 'super_password') + await servers[0].login.login({ user: { username: 'created_user' } }) await checkHook('action:api.user.oauth2-got-token') }) 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 @@ import 'mocha' import { expect } from 'chai' -import { HttpStatusCode } from '@shared/models' import { cleanupTests, - decodeQueryString, createSingleServer, - PluginsCommand, + decodeQueryString, PeerTubeServer, + PluginsCommand, setAccessTokensToServers, wait } from '@shared/extra-utils' -import { UserRole } from '@shared/models' +import { HttpStatusCode, UserRole } from '@shared/models' async function loginExternal (options: { 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 @@ import 'mocha' import * as chai from 'chai' -import { HttpStatusCode } from '@shared/models' import { cleanupTests, createMultipleServers, @@ -15,7 +14,7 @@ import { setDefaultVideoChannel, waitJobs } from '@shared/extra-utils' -import { VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' +import { HttpStatusCode, VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' const expect = chai.expect 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 { cleanupTests, createSingleServer, makeHTMLRequest, - PluginsCommand, PeerTubeServer, + PluginsCommand, setAccessTokensToServers } from '../../../shared/extra-utils' 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 @@ import 'mocha' import { expect } from 'chai' -import { HttpStatusCode } from '@shared/models' -import { cleanupTests, createSingleServer, PluginsCommand, PeerTubeServer, setAccessTokensToServers, wait } from '@shared/extra-utils' -import { UserRole } from '@shared/models' +import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers, wait } from '@shared/extra-utils' +import { HttpStatusCode, UserRole } from '@shared/models' describe('Test id and pass auth plugins', function () { 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 @@ import 'mocha' import { expect } from 'chai' -import { HttpStatusCode } from '@shared/models' import { checkVideoFilesWereRemoved, cleanupTests, - doubleFollow, createMultipleServers, + doubleFollow, makeGetRequest, makePostBodyRequest, - PluginsCommand, PeerTubeServer, + PluginsCommand, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' +import { HttpStatusCode } from '@shared/models' function postCommand (server: PeerTubeServer, command: string, bodyArg?: object) { 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 @@ import 'mocha' import { expect } from 'chai' -import { HttpStatusCode } from '@shared/models' import { cleanupTests, createSingleServer, makeGetRequest, makePostBodyRequest, - PluginsCommand, PeerTubeServer, + PluginsCommand, setAccessTokensToServers } from '@shared/extra-utils' +import { HttpStatusCode } from '@shared/models' describe('Test plugin helpers', function () { 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' import { expect } from 'chai' import { pathExists, readdir, readFile } from 'fs-extra' import { join } from 'path' -import { HttpStatusCode } from '@shared/models' import { cleanupTests, createSingleServer, @@ -13,6 +12,7 @@ import { PluginsCommand, setAccessTokensToServers } from '@shared/extra-utils' +import { HttpStatusCode } from '@shared/models' describe('Test plugin storage', function () { 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 import { cleanupTests, createSingleServer, - PluginsCommand, PeerTubeServer, + PluginsCommand, setAccessTokensToServers, setDefaultVideoChannel, 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 @@ import 'mocha' import { expect } from 'chai' -import { HttpStatusCode } from '@shared/models' import { cleanupTests, createSingleServer, @@ -11,6 +10,7 @@ import { PluginsCommand, setAccessTokensToServers } from '@shared/extra-utils' +import { HttpStatusCode } from '@shared/models' describe('Test plugins module unloading', function () { 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 @@ import 'mocha' import * as chai from 'chai' -import { HttpStatusCode } from '@shared/models' -import { cleanupTests, createSingleServer, PluginsCommand, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' -import { VideoPlaylistPrivacy } from '@shared/models' +import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers } from '@shared/extra-utils' +import { HttpStatusCode, VideoPlaylistPrivacy } from '@shared/models' const expect = chai.expect -- cgit v1.2.3