aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/user-notifications.ts1
-rw-r--r--server/tests/api/notifications/user-notifications.ts41
-rw-r--r--server/tests/api/transcoding/video-editor.ts8
3 files changed, 42 insertions, 8 deletions
diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts
index 4bc8084a1..93355e8b3 100644
--- a/server/tests/api/check-params/user-notifications.ts
+++ b/server/tests/api/check-params/user-notifications.ts
@@ -171,6 +171,7 @@ describe('Test user notifications API validators', function () {
171 abuseNewMessage: UserNotificationSettingValue.WEB, 171 abuseNewMessage: UserNotificationSettingValue.WEB,
172 abuseStateChange: UserNotificationSettingValue.WEB, 172 abuseStateChange: UserNotificationSettingValue.WEB,
173 newPeerTubeVersion: UserNotificationSettingValue.WEB, 173 newPeerTubeVersion: UserNotificationSettingValue.WEB,
174 myVideoEditionFinished: UserNotificationSettingValue.WEB,
174 newPluginVersion: UserNotificationSettingValue.WEB 175 newPluginVersion: UserNotificationSettingValue.WEB
175 } 176 }
176 177
diff --git a/server/tests/api/notifications/user-notifications.ts b/server/tests/api/notifications/user-notifications.ts
index f9f3e0e0e..c87686cb5 100644
--- a/server/tests/api/notifications/user-notifications.ts
+++ b/server/tests/api/notifications/user-notifications.ts
@@ -7,6 +7,7 @@ import {
7 checkMyVideoImportIsFinished, 7 checkMyVideoImportIsFinished,
8 checkNewActorFollow, 8 checkNewActorFollow,
9 checkNewVideoFromSubscription, 9 checkNewVideoFromSubscription,
10 checkVideoEditionIsFinished,
10 checkVideoIsPublished, 11 checkVideoIsPublished,
11 FIXTURE_URLS, 12 FIXTURE_URLS,
12 MockSmtpServer, 13 MockSmtpServer,
@@ -15,7 +16,7 @@ import {
15} from '@server/tests/shared' 16} from '@server/tests/shared'
16import { wait } from '@shared/core-utils' 17import { wait } from '@shared/core-utils'
17import { buildUUID } from '@shared/extra-utils' 18import { buildUUID } from '@shared/extra-utils'
18import { UserNotification, UserNotificationType, VideoPrivacy } from '@shared/models' 19import { UserNotification, UserNotificationType, VideoEditorTask, VideoPrivacy } from '@shared/models'
19import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands' 20import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands'
20 21
21const expect = chai.expect 22const expect = chai.expect
@@ -23,10 +24,12 @@ const expect = chai.expect
23describe('Test user notifications', function () { 24describe('Test user notifications', function () {
24 let servers: PeerTubeServer[] = [] 25 let servers: PeerTubeServer[] = []
25 let userAccessToken: string 26 let userAccessToken: string
27
26 let userNotifications: UserNotification[] = [] 28 let userNotifications: UserNotification[] = []
27 let adminNotifications: UserNotification[] = [] 29 let adminNotifications: UserNotification[] = []
28 let adminNotificationsServer2: UserNotification[] = [] 30 let adminNotificationsServer2: UserNotification[] = []
29 let emails: object[] = [] 31 let emails: object[] = []
32
30 let channelId: number 33 let channelId: number
31 34
32 before(async function () { 35 before(async function () {
@@ -320,6 +323,42 @@ describe('Test user notifications', function () {
320 }) 323 })
321 }) 324 })
322 325
326 describe('Video editor', function () {
327 let baseParams: CheckerBaseParams
328
329 before(() => {
330 baseParams = {
331 server: servers[1],
332 emails,
333 socketNotifications: adminNotificationsServer2,
334 token: servers[1].accessToken
335 }
336 })
337
338 it('Should send a notification after editor edition', async function () {
339 this.timeout(240000)
340
341 const { name, shortUUID, id } = await uploadRandomVideoOnServers(servers, 2, { waitTranscoding: true })
342
343 await waitJobs(servers)
344 await checkVideoIsPublished({ ...baseParams, videoName: name, shortUUID, checkType: 'presence' })
345
346 const tasks: VideoEditorTask[] = [
347 {
348 name: 'cut',
349 options: {
350 start: 0,
351 end: 1
352 }
353 }
354 ]
355 await servers[1].videoEditor.createEditionTasks({ videoId: id, tasks })
356 await waitJobs(servers)
357
358 await checkVideoEditionIsFinished({ ...baseParams, videoName: name, shortUUID, checkType: 'presence' })
359 })
360 })
361
323 describe('My video is imported', function () { 362 describe('My video is imported', function () {
324 let baseParams: CheckerBaseParams 363 let baseParams: CheckerBaseParams
325 364
diff --git a/server/tests/api/transcoding/video-editor.ts b/server/tests/api/transcoding/video-editor.ts
index a9b6950cc..f70bd49e6 100644
--- a/server/tests/api/transcoding/video-editor.ts
+++ b/server/tests/api/transcoding/video-editor.ts
@@ -56,13 +56,7 @@ describe('Test video editor', function () {
56 56
57 await servers[0].config.enableMinimumTranscoding() 57 await servers[0].config.enableMinimumTranscoding()
58 58
59 await servers[0].config.updateExistingSubConfig({ 59 await servers[0].config.enableEditor()
60 newConfig: {
61 videoEditor: {
62 enabled: true
63 }
64 }
65 })
66 }) 60 })
67 61
68 describe('Cutting', function () { 62 describe('Cutting', function () {