diff options
Diffstat (limited to 'server/tests/plugins/video-constants.ts')
-rw-r--r-- | server/tests/plugins/video-constants.ts | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/server/tests/plugins/video-constants.ts b/server/tests/plugins/video-constants.ts index 641e37fbb..facc6bbc1 100644 --- a/server/tests/plugins/video-constants.ts +++ b/server/tests/plugins/video-constants.ts | |||
@@ -17,11 +17,11 @@ describe('Test plugin altering video constants', function () { | |||
17 | server = await flushAndRunServer(1) | 17 | server = await flushAndRunServer(1) |
18 | await setAccessTokensToServers([ server ]) | 18 | await setAccessTokensToServers([ server ]) |
19 | 19 | ||
20 | await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-video-constants') }) | 20 | await server.plugins.install({ path: PluginsCommand.getPluginTestPath('-video-constants') }) |
21 | }) | 21 | }) |
22 | 22 | ||
23 | it('Should have updated languages', async function () { | 23 | it('Should have updated languages', async function () { |
24 | const languages = await server.videosCommand.getLanguages() | 24 | const languages = await server.videos.getLanguages() |
25 | 25 | ||
26 | expect(languages['en']).to.not.exist | 26 | expect(languages['en']).to.not.exist |
27 | expect(languages['fr']).to.not.exist | 27 | expect(languages['fr']).to.not.exist |
@@ -32,7 +32,7 @@ describe('Test plugin altering video constants', function () { | |||
32 | }) | 32 | }) |
33 | 33 | ||
34 | it('Should have updated categories', async function () { | 34 | it('Should have updated categories', async function () { |
35 | const categories = await server.videosCommand.getCategories() | 35 | const categories = await server.videos.getCategories() |
36 | 36 | ||
37 | expect(categories[1]).to.not.exist | 37 | expect(categories[1]).to.not.exist |
38 | expect(categories[2]).to.not.exist | 38 | expect(categories[2]).to.not.exist |
@@ -42,7 +42,7 @@ describe('Test plugin altering video constants', function () { | |||
42 | }) | 42 | }) |
43 | 43 | ||
44 | it('Should have updated licences', async function () { | 44 | it('Should have updated licences', async function () { |
45 | const licences = await server.videosCommand.getLicences() | 45 | const licences = await server.videos.getLicences() |
46 | 46 | ||
47 | expect(licences[1]).to.not.exist | 47 | expect(licences[1]).to.not.exist |
48 | expect(licences[7]).to.not.exist | 48 | expect(licences[7]).to.not.exist |
@@ -52,7 +52,7 @@ describe('Test plugin altering video constants', function () { | |||
52 | }) | 52 | }) |
53 | 53 | ||
54 | it('Should have updated video privacies', async function () { | 54 | it('Should have updated video privacies', async function () { |
55 | const privacies = await server.videosCommand.getPrivacies() | 55 | const privacies = await server.videos.getPrivacies() |
56 | 56 | ||
57 | expect(privacies[1]).to.exist | 57 | expect(privacies[1]).to.exist |
58 | expect(privacies[2]).to.not.exist | 58 | expect(privacies[2]).to.not.exist |
@@ -61,7 +61,7 @@ describe('Test plugin altering video constants', function () { | |||
61 | }) | 61 | }) |
62 | 62 | ||
63 | it('Should have updated playlist privacies', async function () { | 63 | it('Should have updated playlist privacies', async function () { |
64 | const playlistPrivacies = await server.playlistsCommand.getPrivacies() | 64 | const playlistPrivacies = await server.playlists.getPrivacies() |
65 | 65 | ||
66 | expect(playlistPrivacies[1]).to.exist | 66 | expect(playlistPrivacies[1]).to.exist |
67 | expect(playlistPrivacies[2]).to.exist | 67 | expect(playlistPrivacies[2]).to.exist |
@@ -70,29 +70,29 @@ describe('Test plugin altering video constants', function () { | |||
70 | 70 | ||
71 | it('Should not be able to create a video with this privacy', async function () { | 71 | it('Should not be able to create a video with this privacy', async function () { |
72 | const attributes = { name: 'video', privacy: 2 } | 72 | const attributes = { name: 'video', privacy: 2 } |
73 | await server.videosCommand.upload({ attributes, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | 73 | await server.videos.upload({ attributes, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) |
74 | }) | 74 | }) |
75 | 75 | ||
76 | it('Should not be able to create a video with this privacy', async function () { | 76 | it('Should not be able to create a video with this privacy', async function () { |
77 | const attributes = { displayName: 'video playlist', privacy: VideoPlaylistPrivacy.PRIVATE } | 77 | const attributes = { displayName: 'video playlist', privacy: VideoPlaylistPrivacy.PRIVATE } |
78 | await server.playlistsCommand.create({ attributes, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | 78 | await server.playlists.create({ attributes, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) |
79 | }) | 79 | }) |
80 | 80 | ||
81 | it('Should be able to upload a video with these values', async function () { | 81 | it('Should be able to upload a video with these values', async function () { |
82 | const attributes = { name: 'video', category: 42, licence: 42, language: 'al_bhed2' } | 82 | const attributes = { name: 'video', category: 42, licence: 42, language: 'al_bhed2' } |
83 | const { uuid } = await server.videosCommand.upload({ attributes }) | 83 | const { uuid } = await server.videos.upload({ attributes }) |
84 | 84 | ||
85 | const video = await server.videosCommand.get({ id: uuid }) | 85 | const video = await server.videos.get({ id: uuid }) |
86 | expect(video.language.label).to.equal('Al Bhed 2') | 86 | expect(video.language.label).to.equal('Al Bhed 2') |
87 | expect(video.licence.label).to.equal('Best licence') | 87 | expect(video.licence.label).to.equal('Best licence') |
88 | expect(video.category.label).to.equal('Best category') | 88 | expect(video.category.label).to.equal('Best category') |
89 | }) | 89 | }) |
90 | 90 | ||
91 | it('Should uninstall the plugin and reset languages, categories, licences and privacies', async function () { | 91 | it('Should uninstall the plugin and reset languages, categories, licences and privacies', async function () { |
92 | await server.pluginsCommand.uninstall({ npmName: 'peertube-plugin-test-video-constants' }) | 92 | await server.plugins.uninstall({ npmName: 'peertube-plugin-test-video-constants' }) |
93 | 93 | ||
94 | { | 94 | { |
95 | const languages = await server.videosCommand.getLanguages() | 95 | const languages = await server.videos.getLanguages() |
96 | 96 | ||
97 | expect(languages['en']).to.equal('English') | 97 | expect(languages['en']).to.equal('English') |
98 | expect(languages['fr']).to.equal('French') | 98 | expect(languages['fr']).to.equal('French') |
@@ -103,7 +103,7 @@ describe('Test plugin altering video constants', function () { | |||
103 | } | 103 | } |
104 | 104 | ||
105 | { | 105 | { |
106 | const categories = await server.videosCommand.getCategories() | 106 | const categories = await server.videos.getCategories() |
107 | 107 | ||
108 | expect(categories[1]).to.equal('Music') | 108 | expect(categories[1]).to.equal('Music') |
109 | expect(categories[2]).to.equal('Films') | 109 | expect(categories[2]).to.equal('Films') |
@@ -113,7 +113,7 @@ describe('Test plugin altering video constants', function () { | |||
113 | } | 113 | } |
114 | 114 | ||
115 | { | 115 | { |
116 | const licences = await server.videosCommand.getLicences() | 116 | const licences = await server.videos.getLicences() |
117 | 117 | ||
118 | expect(licences[1]).to.equal('Attribution') | 118 | expect(licences[1]).to.equal('Attribution') |
119 | expect(licences[7]).to.equal('Public Domain Dedication') | 119 | expect(licences[7]).to.equal('Public Domain Dedication') |
@@ -123,7 +123,7 @@ describe('Test plugin altering video constants', function () { | |||
123 | } | 123 | } |
124 | 124 | ||
125 | { | 125 | { |
126 | const privacies = await server.videosCommand.getPrivacies() | 126 | const privacies = await server.videos.getPrivacies() |
127 | 127 | ||
128 | expect(privacies[1]).to.exist | 128 | expect(privacies[1]).to.exist |
129 | expect(privacies[2]).to.exist | 129 | expect(privacies[2]).to.exist |
@@ -132,7 +132,7 @@ describe('Test plugin altering video constants', function () { | |||
132 | } | 132 | } |
133 | 133 | ||
134 | { | 134 | { |
135 | const playlistPrivacies = await server.playlistsCommand.getPrivacies() | 135 | const playlistPrivacies = await server.playlists.getPrivacies() |
136 | 136 | ||
137 | expect(playlistPrivacies[1]).to.exist | 137 | expect(playlistPrivacies[1]).to.exist |
138 | expect(playlistPrivacies[2]).to.exist | 138 | expect(playlistPrivacies[2]).to.exist |