From 799ece6aae8ef55b50b6193de3c4d46e7bb258f5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 15 Jun 2021 15:18:11 +0200 Subject: Add ability to delete previously added constants --- .../peertube-plugin-test-video-constants/main.js | 46 ++++++++++++++++++++++ .../package.json | 20 ++++++++++ 2 files changed, 66 insertions(+) create mode 100644 server/tests/fixtures/peertube-plugin-test-video-constants/main.js create mode 100644 server/tests/fixtures/peertube-plugin-test-video-constants/package.json (limited to 'server/tests/fixtures/peertube-plugin-test-video-constants') diff --git a/server/tests/fixtures/peertube-plugin-test-video-constants/main.js b/server/tests/fixtures/peertube-plugin-test-video-constants/main.js new file mode 100644 index 000000000..3e650e0a1 --- /dev/null +++ b/server/tests/fixtures/peertube-plugin-test-video-constants/main.js @@ -0,0 +1,46 @@ +async function register ({ + registerHook, + registerSetting, + settingsManager, + storageManager, + videoCategoryManager, + videoLicenceManager, + videoLanguageManager, + videoPrivacyManager, + playlistPrivacyManager +}) { + videoLanguageManager.addLanguage('al_bhed', 'Al Bhed') + videoLanguageManager.addLanguage('al_bhed2', 'Al Bhed 2') + videoLanguageManager.addLanguage('al_bhed3', 'Al Bhed 3') + videoLanguageManager.deleteLanguage('en') + videoLanguageManager.deleteLanguage('fr') + videoLanguageManager.deleteLanguage('al_bhed3') + + videoCategoryManager.addCategory(42, 'Best category') + videoCategoryManager.addCategory(43, 'High best category') + videoCategoryManager.deleteCategory(1) // Music + videoCategoryManager.deleteCategory(2) // Films + + videoLicenceManager.addLicence(42, 'Best licence') + videoLicenceManager.addLicence(43, 'High best licence') + videoLicenceManager.deleteLicence(1) // Attribution + videoLicenceManager.deleteLicence(7) // Public domain + + videoPrivacyManager.deletePrivacy(2) + playlistPrivacyManager.deletePlaylistPrivacy(3) +} + +async function unregister () { + return +} + +module.exports = { + register, + unregister +} + +// ############################################################################ + +function addToCount (obj) { + return Object.assign({}, obj, { count: obj.count + 1 }) +} diff --git a/server/tests/fixtures/peertube-plugin-test-video-constants/package.json b/server/tests/fixtures/peertube-plugin-test-video-constants/package.json new file mode 100644 index 000000000..0fcf39933 --- /dev/null +++ b/server/tests/fixtures/peertube-plugin-test-video-constants/package.json @@ -0,0 +1,20 @@ +{ + "name": "peertube-plugin-test-video-constants", + "version": "0.0.1", + "description": "Plugin test video constants", + "engine": { + "peertube": ">=1.3.0" + }, + "keywords": [ + "peertube", + "plugin" + ], + "homepage": "https://github.com/Chocobozzz/PeerTube", + "author": "Chocobozzz", + "bugs": "https://github.com/Chocobozzz/PeerTube/issues", + "library": "./main.js", + "staticDirs": {}, + "css": [], + "clientScripts": [], + "translations": {} +} -- cgit v1.2.3