]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/plugins/translations.ts
Introduce generic video constant manager for plugins
[github/Chocobozzz/PeerTube.git] / server / tests / plugins / translations.ts
index 88d91a03338f4782b53ee42e1ed1a964348a121b..9fd2ba1c5e0b8181ba4da78b6cba602c319aca29 100644 (file)
@@ -1,38 +1,15 @@
-/* tslint:disable:no-unused-expression */
+/* 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 {
-  cleanupTests,
-  flushAndRunMultipleServers,
-  flushAndRunServer, killallServers, reRunServer,
-  ServerInfo,
-  waitUntilLog
-} from '../../../shared/extra-utils/server/servers'
-import {
-  addVideoCommentReply,
-  addVideoCommentThread,
-  deleteVideoComment,
   getPluginTestPath,
-  getVideosList,
+  getPluginTranslations,
   installPlugin,
-  removeVideo,
   setAccessTokensToServers,
-  updateVideo,
-  uploadVideo,
-  viewVideo,
-  getVideosListPagination,
-  getVideo,
-  getVideoCommentThreads,
-  getVideoThreadComments,
-  getVideoWithToken,
-  setDefaultVideoChannel,
-  waitJobs,
-  doubleFollow, getVideoLanguages, getVideoLicences, getVideoCategories, uninstallPlugin, getPluginTranslations
+  uninstallPlugin
 } from '../../../shared/extra-utils'
-import { VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model'
-import { VideoDetails } from '../../../shared/models/videos'
-import { getYoutubeVideoUrl, importVideo } from '../../../shared/extra-utils/videos/video-imports'
 
 const expect = chai.expect
 
@@ -54,7 +31,7 @@ describe('Test plugin translations', function () {
     await installPlugin({
       url: server.url,
       accessToken: server.accessToken,
-      path: getPluginTestPath('-two')
+      path: getPluginTestPath('-filter-translations')
     })
   })
 
@@ -69,9 +46,9 @@ describe('Test plugin translations', function () {
 
     expect(res.body).to.deep.equal({
       'peertube-plugin-test': {
-        'Hi': 'Coucou'
+        Hi: 'Coucou'
       },
-      'peertube-plugin-test-two': {
+      'peertube-plugin-test-filter-translations': {
         'Hello world': 'Bonjour le monde'
       }
     })
@@ -81,21 +58,21 @@ describe('Test plugin translations', function () {
     const res = await getPluginTranslations({ url: server.url, locale: 'it-IT' })
 
     expect(res.body).to.deep.equal({
-      'peertube-plugin-test-two': {
+      'peertube-plugin-test-filter-translations': {
         'Hello world': 'Ciao, mondo!'
       }
     })
   })
 
   it('Should remove the plugin and remove the locales', async function () {
-    await uninstallPlugin({ url: server.url, accessToken: server.accessToken, npmName: 'peertube-plugin-test-two' })
+    await uninstallPlugin({ url: server.url, accessToken: server.accessToken, npmName: 'peertube-plugin-test-filter-translations' })
 
     {
       const res = await getPluginTranslations({ url: server.url, locale: 'fr-FR' })
 
       expect(res.body).to.deep.equal({
         'peertube-plugin-test': {
-          'Hi': 'Coucou'
+          Hi: 'Coucou'
         }
       })
     }