diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-22 14:35:04 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-22 16:25:14 +0100 |
commit | 1808a1f8e4b7b102823492a2007a46929aebf189 (patch) | |
tree | a345140ec9a7a20c222ace3cda18ac999277c8c3 /server/tests/api/notifications/user-notifications.ts | |
parent | 348c2ce3ff3fe2f25a31f08bfb36c88723a0ce46 (diff) | |
download | PeerTube-1808a1f8e4b7b102823492a2007a46929aebf189.tar.gz PeerTube-1808a1f8e4b7b102823492a2007a46929aebf189.tar.zst PeerTube-1808a1f8e4b7b102823492a2007a46929aebf189.zip |
Add video edition finished notification
Diffstat (limited to 'server/tests/api/notifications/user-notifications.ts')
-rw-r--r-- | server/tests/api/notifications/user-notifications.ts | 41 |
1 files changed, 40 insertions, 1 deletions
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' |
16 | import { wait } from '@shared/core-utils' | 17 | import { wait } from '@shared/core-utils' |
17 | import { buildUUID } from '@shared/extra-utils' | 18 | import { buildUUID } from '@shared/extra-utils' |
18 | import { UserNotification, UserNotificationType, VideoPrivacy } from '@shared/models' | 19 | import { UserNotification, UserNotificationType, VideoEditorTask, VideoPrivacy } from '@shared/models' |
19 | import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands' | 20 | import { cleanupTests, PeerTubeServer, waitJobs } from '@shared/server-commands' |
20 | 21 | ||
21 | const expect = chai.expect | 22 | const expect = chai.expect |
@@ -23,10 +24,12 @@ const expect = chai.expect | |||
23 | describe('Test user notifications', function () { | 24 | describe('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 | ||