+async function checkVideoStudioEditionIsFinished (options: CheckerBaseParams & {
+ videoName: string
+ shortUUID: string
+ checkType: CheckerType
+}) {
+ const { videoName, shortUUID } = options
+ const notificationType = UserNotificationType.MY_VIDEO_STUDIO_EDITION_FINISHED
+
+ function notificationChecker (notification: UserNotification, checkType: CheckerType) {
+ if (checkType === 'presence') {
+ expect(notification).to.not.be.undefined
+ expect(notification.type).to.equal(notificationType)
+
+ checkVideo(notification.video, videoName, shortUUID)
+ checkActor(notification.video.channel)
+ } else {
+ expect(notification.video).to.satisfy(v => v === undefined || v.name !== videoName)
+ }
+ }
+
+ function emailNotificationFinder (email: object) {
+ const text: string = email['text']
+ return text.includes(shortUUID) && text.includes('Edition of your video')
+ }
+
+ await checkNotification({ ...options, notificationChecker, emailNotificationFinder })
+}
+