aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-15 15:18:11 +0200
committerChocobozzz <me@florianbigard.com>2021-06-15 15:18:11 +0200
commit799ece6aae8ef55b50b6193de3c4d46e7bb258f5 (patch)
tree2238fe2a60b7dd7bbc628c3d58f7941461439e7b /server/tests
parent4c3e4c3d93a08edd5d2ed8f102e54ed2d9307ace (diff)
downloadPeerTube-799ece6aae8ef55b50b6193de3c4d46e7bb258f5.tar.gz
PeerTube-799ece6aae8ef55b50b6193de3c4d46e7bb258f5.tar.zst
PeerTube-799ece6aae8ef55b50b6193de3c4d46e7bb258f5.zip
Add ability to delete previously added constants
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-video-constants/main.js (renamed from server/tests/fixtures/peertube-plugin-test-three/main.js)2
-rw-r--r--server/tests/fixtures/peertube-plugin-test-video-constants/package.json (renamed from server/tests/fixtures/peertube-plugin-test-three/package.json)4
-rw-r--r--server/tests/plugins/video-constants.ts6
3 files changed, 8 insertions, 4 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-three/main.js b/server/tests/fixtures/peertube-plugin-test-video-constants/main.js
index f2b89bcf0..3e650e0a1 100644
--- a/server/tests/fixtures/peertube-plugin-test-three/main.js
+++ b/server/tests/fixtures/peertube-plugin-test-video-constants/main.js
@@ -11,8 +11,10 @@ async function register ({
11}) { 11}) {
12 videoLanguageManager.addLanguage('al_bhed', 'Al Bhed') 12 videoLanguageManager.addLanguage('al_bhed', 'Al Bhed')
13 videoLanguageManager.addLanguage('al_bhed2', 'Al Bhed 2') 13 videoLanguageManager.addLanguage('al_bhed2', 'Al Bhed 2')
14 videoLanguageManager.addLanguage('al_bhed3', 'Al Bhed 3')
14 videoLanguageManager.deleteLanguage('en') 15 videoLanguageManager.deleteLanguage('en')
15 videoLanguageManager.deleteLanguage('fr') 16 videoLanguageManager.deleteLanguage('fr')
17 videoLanguageManager.deleteLanguage('al_bhed3')
16 18
17 videoCategoryManager.addCategory(42, 'Best category') 19 videoCategoryManager.addCategory(42, 'Best category')
18 videoCategoryManager.addCategory(43, 'High best category') 20 videoCategoryManager.addCategory(43, 'High best category')
diff --git a/server/tests/fixtures/peertube-plugin-test-three/package.json b/server/tests/fixtures/peertube-plugin-test-video-constants/package.json
index 41d4c93fe..0fcf39933 100644
--- a/server/tests/fixtures/peertube-plugin-test-three/package.json
+++ b/server/tests/fixtures/peertube-plugin-test-video-constants/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "name": "peertube-plugin-test-three", 2 "name": "peertube-plugin-test-video-constants",
3 "version": "0.0.1", 3 "version": "0.0.1",
4 "description": "Plugin test 3", 4 "description": "Plugin test video constants",
5 "engine": { 5 "engine": {
6 "peertube": ">=1.3.0" 6 "peertube": ">=1.3.0"
7 }, 7 },
diff --git a/server/tests/plugins/video-constants.ts b/server/tests/plugins/video-constants.ts
index 5ee41fee1..eb014c596 100644
--- a/server/tests/plugins/video-constants.ts
+++ b/server/tests/plugins/video-constants.ts
@@ -32,7 +32,7 @@ describe('Test plugin altering video constants', function () {
32 await installPlugin({ 32 await installPlugin({
33 url: server.url, 33 url: server.url,
34 accessToken: server.accessToken, 34 accessToken: server.accessToken,
35 path: getPluginTestPath('-three') 35 path: getPluginTestPath('-video-constants')
36 }) 36 })
37 }) 37 })
38 38
@@ -45,6 +45,7 @@ describe('Test plugin altering video constants', function () {
45 45
46 expect(languages['al_bhed']).to.equal('Al Bhed') 46 expect(languages['al_bhed']).to.equal('Al Bhed')
47 expect(languages['al_bhed2']).to.equal('Al Bhed 2') 47 expect(languages['al_bhed2']).to.equal('Al Bhed 2')
48 expect(languages['al_bhed3']).to.not.exist
48 }) 49 })
49 50
50 it('Should have updated categories', async function () { 51 it('Should have updated categories', async function () {
@@ -116,7 +117,7 @@ describe('Test plugin altering video constants', function () {
116 }) 117 })
117 118
118 it('Should uninstall the plugin and reset languages, categories, licences and privacies', async function () { 119 it('Should uninstall the plugin and reset languages, categories, licences and privacies', async function () {
119 await uninstallPlugin({ url: server.url, accessToken: server.accessToken, npmName: 'peertube-plugin-test-three' }) 120 await uninstallPlugin({ url: server.url, accessToken: server.accessToken, npmName: 'peertube-plugin-test-video-constants' })
120 121
121 { 122 {
122 const res = await getVideoLanguages(server.url) 123 const res = await getVideoLanguages(server.url)
@@ -127,6 +128,7 @@ describe('Test plugin altering video constants', function () {
127 128
128 expect(languages['al_bhed']).to.not.exist 129 expect(languages['al_bhed']).to.not.exist
129 expect(languages['al_bhed2']).to.not.exist 130 expect(languages['al_bhed2']).to.not.exist
131 expect(languages['al_bhed3']).to.not.exist
130 } 132 }
131 133
132 { 134 {