]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Improve plugin constant tests
authorChocobozzz <me@florianbigard.com>
Wed, 21 Jul 2021 13:44:28 +0000 (15:44 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 21 Jul 2021 13:44:28 +0000 (15:44 +0200)
scripts/ci.sh
server/tests/fixtures/peertube-plugin-test-video-constants/main.js
server/tests/index.ts
server/tests/lib/index.ts [new file with mode: 0644]
server/tests/lib/video-constant-registry-factory.ts [moved from server/tests/lib/plugins/video-constant-registry-factory.test.ts with 100% similarity]

index 07e37e0eee82ce393f20ac7634e5c03b795d2c9f..7862888b8e2e019176846ea71da52fda57d50bd1 100755 (executable)
@@ -47,11 +47,12 @@ if [ "$1" = "client" ]; then
 
     feedsFiles=$(findTestFiles ./dist/server/tests/feeds)
     helperFiles=$(findTestFiles ./dist/server/tests/helpers)
+    libFiles=$(findTestFiles ./dist/server/tests/lib)
     miscFiles="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js"
     # Not in plugin task, it needs an index.html
     pluginFiles="./dist/server/tests/plugins/html-injection.js"
 
-    MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles
+    MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles $libFiles
 elif [ "$1" = "cli-plugin" ]; then
     npm run build:server
     npm run setup:cli
index f44704a4489fd994a81752d8319743f1043080ec..06527bd358fbd2a28561df99011fe64da9db6cf7 100644 (file)
@@ -7,24 +7,26 @@ async function register ({
   getRouter
 }) {
   videoLanguageManager.addConstant('al_bhed', 'Al Bhed')
-  videoLanguageManager.addConstant('al_bhed2', 'Al Bhed 2')
+  videoLanguageManager.addLanguage('al_bhed2', 'Al Bhed 2')
   videoLanguageManager.addConstant('al_bhed3', 'Al Bhed 3')
   videoLanguageManager.deleteConstant('en')
-  videoLanguageManager.deleteConstant('fr')
+  videoLanguageManager.deleteLanguage('fr')
   videoLanguageManager.deleteConstant('al_bhed3')
 
-  videoCategoryManager.addConstant(42, 'Best category')
+  videoCategoryManager.addCategory(42, 'Best category')
   videoCategoryManager.addConstant(43, 'High best category')
   videoCategoryManager.deleteConstant(1) // Music
-  videoCategoryManager.deleteConstant(2) // Films
+  videoCategoryManager.deleteCategory(2) // Films
 
-  videoLicenceManager.addConstant(42, 'Best licence')
+  videoLicenceManager.addLicence(42, 'Best licence')
   videoLicenceManager.addConstant(43, 'High best licence')
   videoLicenceManager.deleteConstant(1) // Attribution
   videoLicenceManager.deleteConstant(7) // Public domain
 
   videoPrivacyManager.deleteConstant(2)
+  videoPrivacyManager.deletePrivacy(2)
   playlistPrivacyManager.deleteConstant(3)
+  playlistPrivacyManager.deletePlaylistPrivacy(3)
 
   {
     const router = getRouter()
index 3fbd0ebbde20b0fb0abd17047909307c0d4e93c6..1718ac424079da029bb2f92428ca1a7addb868ea 100644 (file)
@@ -6,3 +6,4 @@ import './cli/'
 import './api/'
 import './plugins/'
 import './helpers/'
+import './lib/'
diff --git a/server/tests/lib/index.ts b/server/tests/lib/index.ts
new file mode 100644 (file)
index 0000000..a40df35
--- /dev/null
@@ -0,0 +1 @@
+export * from './video-constant-registry-factory'