From 4cb45d924ac28dd5944f97a7001d287de5fd164a Mon Sep 17 00:00:00 2001 From: Aaron shiel <57824522+aaronshiel@users.noreply.github.com> Date: Wed, 27 Apr 2022 19:18:57 -0700 Subject: [PATCH] GQL data request updated with new media and task shapes (#182) * GQL data request updated with new media and task shapes --- client/src/api.ts | 116 +- .../import-export/import-answer.tsx | 14 +- .../hooks/graphql/upload-status-helpers.ts | 11 - .../hooks/graphql/use-with-record-state.tsx | 10 - .../hooks/graphql/use-with-upload-status.tsx | 62 +- client/src/types-gql.ts | 74 +- client/src/types.ts | 1 - .../cypress/integration/filemanager.spec.ts | 24 +- cypress/cypress/integration/index.spec.ts | 101 +- cypress/cypress/integration/record.spec.ts | 2423 ++--------------- cypress/cypress/support/types.ts | 1 - 11 files changed, 473 insertions(+), 2364 deletions(-) diff --git a/client/src/api.ts b/client/src/api.ts index c41d0e3f..a260b3e2 100644 --- a/client/src/api.ts +++ b/client/src/api.ts @@ -2,6 +2,11 @@ This software is Copyright ©️ 2020 The University of Southern California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and subject to the full license file found in the root of this software deliverable. Permission to make commercial use of this software may be obtained by contacting: USC Stevens Center for Innovation University of Southern California 1150 S. Olive Street, Suite 2300, Los Angeles, CA 90115, USA Email: accounting@stevens.usc.edu +The full terms of this copyright and license should always be found in the root directory of this software deliverable as "license.txt" and if these terms are not found with this software, please contact the USC Stevens Center for the full license. +*/ +/* +This software is Copyright ©️ 2020 The University of Southern California. All Rights Reserved. +Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and subject to the full license file found in the root of this software deliverable. Permission to make commercial use of this software may be obtained by contacting: USC Stevens Center for Innovation University of Southern California 1150 S. Olive Street, Suite 2300, Los Angeles, CA 90115, USA Email: accounting@stevens.usc.edu The full terms of this copyright and license should always be found in the root directory of this software deliverable as "license.txt" and if these terms are not found with this software, please contact the USC Stevens Center for the full license. */ import axios, { @@ -22,7 +27,6 @@ import { TaskStatus, TrainingInfo, VideoInfo, - CancelJob, FollowUpQuestion, User, Config, @@ -842,7 +846,19 @@ export async function fetchMentorById( transcript status hasUntransferredMedia - media { + webMedia { + type + tag + url + needsTransfer + } + mobileMedia{ + type + tag + url + needsTransfer + } + vttMedia{ type tag url @@ -1120,28 +1136,6 @@ export async function fetchVideoBlobFromUrl(url: string): Promise { return result.data; } -export async function cancelUploadVideo( - mentorId: string, - question: string, - taskIds: string[], - accessToken: string -): Promise { - const result = await uploadRequest.post( - "/answer/cancel", - { - mentor: mentorId, - question: question, - task_ids_to_cancel: taskIds, - }, - { - headers: { - Authorization: `Bearer ${accessToken}`, - }, - } - ); - return getDataFromAxiosResponse(result, []); -} - export async function fetchUploadVideoStatus( statusUrl: string ): Promise> { @@ -1209,13 +1203,39 @@ export async function fetchUploadTasks( _id question } - taskList{ + trimUploadTask{ + task_name + status + } + transcodeWebTask{ + task_name + status + } + transcodeMobileTask{ + task_name + status + } + transcribeTask{ task_name - task_id status } transcript - media { + originalMedia { + type + tag + url + } + webMedia { + type + tag + url + } + mobileMedia{ + type + tag + url + } + vttMedia{ type tag url @@ -1321,7 +1341,19 @@ export async function exportMentor(mentor: string): Promise { transcript status hasUntransferredMedia - media { + webMedia { + type + tag + url + needsTransfer + } + mobileMedia{ + type + tag + url + needsTransfer + } + vttMedia{ type tag url @@ -1495,7 +1527,19 @@ export async function importMentorPreview( transcript status hasUntransferredMedia - media { + webMedia { + type + tag + url + needsTransfer + } + mobileMedia{ + type + tag + url + needsTransfer + } + vttMedia{ type tag url @@ -1517,7 +1561,19 @@ export async function importMentorPreview( status hasEditedTranscript hasUntransferredMedia - media { + webMedia { + type + tag + url + needsTransfer + } + mobileMedia{ + type + tag + url + needsTransfer + } + vttMedia{ type tag url diff --git a/client/src/components/import-export/import-answer.tsx b/client/src/components/import-export/import-answer.tsx index 260ae68f..de787897 100644 --- a/client/src/components/import-export/import-answer.tsx +++ b/client/src/components/import-export/import-answer.tsx @@ -24,7 +24,7 @@ import { } from "@material-ui/icons"; import { EditType, ImportPreview, Media } from "types"; import { ChangeIcon } from "./icons"; -import { AnswerGQL } from "types-gql"; +import { AnswerGQL, getAnswerGQLMediaList } from "types-gql"; const useStyles = makeStyles(() => ({ root: { @@ -69,8 +69,10 @@ export default function AnswerImport(props: { } const media: ImportPreview[] = []; - answer?.media?.forEach((m) => { - const curMedia = curAnswer?.media?.find( + const importAnswerMedia = answer ? getAnswerGQLMediaList(answer) : []; + const curAnswerMedia = curAnswer ? getAnswerGQLMediaList(curAnswer) : []; + importAnswerMedia.forEach((m) => { + const curMedia = curAnswerMedia.find( (mm) => mm.tag === m.tag && mm.type === m.type ); media.push({ @@ -79,10 +81,10 @@ export default function AnswerImport(props: { curData: curMedia, }); }); - curAnswer?.media - ?.filter( + curAnswerMedia + .filter( (mm) => - !answer?.media?.find((m) => m.type === mm.type && m.tag === mm.tag) + !importAnswerMedia.find((m) => m.type === mm.type && m.tag === mm.tag) ) .forEach((m) => { media.push({ diff --git a/client/src/hooks/graphql/upload-status-helpers.ts b/client/src/hooks/graphql/upload-status-helpers.ts index 7a37bd38..32ca1b8e 100644 --- a/client/src/hooks/graphql/upload-status-helpers.ts +++ b/client/src/hooks/graphql/upload-status-helpers.ts @@ -38,17 +38,6 @@ export function areAllTasksDone(task: UploadTask): boolean { return compareTaskStatusesToValue(task, UploadTaskStatuses.DONE, true); } -export function fetchIncompleteTaskIds(task: UploadTask): string[] { - if (!task.taskList.length) return []; - return task.taskList - .filter( - (task) => - task.status !== UploadTaskStatuses.FAILED && - task.status !== UploadTaskStatuses.DONE - ) - .map((task) => task.task_id); -} - export function compareTaskStatusesToValue( task: UploadTask, value: UploadTaskStatuses, diff --git a/client/src/hooks/graphql/use-with-record-state.tsx b/client/src/hooks/graphql/use-with-record-state.tsx index 658e5ec4..fdb824b3 100644 --- a/client/src/hooks/graphql/use-with-record-state.tsx +++ b/client/src/hooks/graphql/use-with-record-state.tsx @@ -104,7 +104,6 @@ export function useWithRecordState( isUploading, pollStatusCount, upload, - cancelUpload, removeCompletedOrFailedTask, } = useWithUploadStatus( accessToken, @@ -575,13 +574,6 @@ export function useWithRecordState( downloadVideoForQuestion(curAnswer?.answer.question); } - function cancelUploadVideo(task: UploadTask) { - if (!mentorId) { - return; - } - cancelUpload(mentorId, task); - } - return { mentorQuestions, mentorSubjects, @@ -611,7 +603,6 @@ export function useWithRecordState( uploadVideo, downloadCurAnswerVideo, downloadVideoFromUpload, - cancelUpload: cancelUploadVideo, setMinVideoLength, clearError, }; @@ -646,7 +637,6 @@ export interface UseWithRecordState { uploadVideo: (trim?: { start: number; end: number }) => void; downloadCurAnswerVideo: () => void; downloadVideoFromUpload: (upload: UploadTask) => void; - cancelUpload: (task: UploadTask) => void; setMinVideoLength: (length: number) => void; clearError: () => void; } diff --git a/client/src/hooks/graphql/use-with-upload-status.tsx b/client/src/hooks/graphql/use-with-upload-status.tsx index 079dfa9f..afc62f8f 100644 --- a/client/src/hooks/graphql/use-with-upload-status.tsx +++ b/client/src/hooks/graphql/use-with-upload-status.tsx @@ -6,12 +6,7 @@ The full terms of this copyright and license should always be found in the root */ import { useEffect, useState } from "react"; import axios from "axios"; -import { - cancelUploadVideo, - deleteUploadTask, - fetchUploadTasks, - uploadVideo, -} from "api"; +import { deleteUploadTask, fetchUploadTasks, uploadVideo } from "api"; import { UploadTask, UploadTaskStatuses } from "types"; import { copyAndSet } from "helpers"; import useInterval from "hooks/task/use-interval"; @@ -23,7 +18,6 @@ import { isATaskFailed, areAllTasksDoneOrOneFailed, whichTaskFailed, - fetchIncompleteTaskIds, } from "./upload-status-helpers"; import { useActiveMentor } from "store/slices/mentor/useActiveMentor"; @@ -188,7 +182,6 @@ export function useWithUploadStatus( taskList: [ { task_name: "upload", - task_id: "", status: UploadTaskStatuses.QUEUED, }, ], @@ -217,7 +210,6 @@ export function useWithUploadStatus( taskList: [ { task_name: "trim_upload", - task_id: "", status: UploadTaskStatuses.FAILED, }, ], @@ -227,62 +219,11 @@ export function useWithUploadStatus( }); } - function cancelUpload(mentorId: string, task: UploadTask) { - if (!task.taskList.length) { - task.tokenSource?.cancel(UploadTaskStatuses.CANCELLED); - addOrEditTask({ - ...task, - taskList: [ - { - task_name: "trim_upload", - task_id: "", - status: UploadTaskStatuses.CANCELLED, - }, - ], - isCancelling: true, - }); - return; - } - addOrEditTask({ - ...task, - isCancelling: true, - }); - cancelUploadVideo( - mentorId, - task.question, - fetchIncompleteTaskIds(task), - accessToken - ) - .then(() => { - addOrEditTask({ - ...task, - taskList: [ - { - task_name: "trim_upload", - task_id: "", - status: UploadTaskStatuses.CANCELLED, - }, - ], - isCancelling: true, - }); - }) - .catch((err) => { - console.error(err); - addOrEditTask({ - ...task, - isCancelling: true, - }); - }); - } - - // function deleteUpload() {} - return { pollStatusCount, uploads, isUploading, upload, - cancelUpload, removeCompletedOrFailedTask, }; } @@ -298,6 +239,5 @@ export interface UseWithUploadStatus { trim?: { start: number; end: number }, hasEditedTranscript?: boolean ) => void; - cancelUpload: (mentorId: string, task: UploadTask) => void; removeCompletedOrFailedTask: (tasks: UploadTask) => void; } diff --git a/client/src/types-gql.ts b/client/src/types-gql.ts index 1d2d1412..221cdb97 100644 --- a/client/src/types-gql.ts +++ b/client/src/types-gql.ts @@ -2,6 +2,11 @@ This software is Copyright ©️ 2020 The University of Southern California. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and subject to the full license file found in the root of this software deliverable. Permission to make commercial use of this software may be obtained by contacting: USC Stevens Center for Innovation University of Southern California 1150 S. Olive Street, Suite 2300, Los Angeles, CA 90115, USA Email: accounting@stevens.usc.edu +The full terms of this copyright and license should always be found in the root directory of this software deliverable as "license.txt" and if these terms are not found with this software, please contact the USC Stevens Center for the full license. +*/ +/* +This software is Copyright ©️ 2020 The University of Southern California. All Rights Reserved. +Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and subject to the full license file found in the root of this software deliverable. Permission to make commercial use of this software may be obtained by contacting: USC Stevens Center for Innovation University of Southern California 1150 S. Olive Street, Suite 2300, Los Angeles, CA 90115, USA Email: accounting@stevens.usc.edu The full terms of this copyright and license should always be found in the root directory of this software deliverable as "license.txt" and if these terms are not found with this software, please contact the USC Stevens Center for the full license. */ @@ -87,7 +92,9 @@ export interface AnswerGQL { hasEditedTranscript: boolean; transcript: string; status: Status; - media?: Media[]; + webMedia?: Media; + mobileMedia?: Media; + vttMedia?: Media; hasUntransferredMedia: boolean; } @@ -106,13 +113,19 @@ export interface UserQuestionGQL { export interface UploadTaskGQL { question: Question; - taskList: TaskInfo[]; + trimUploadTask?: TaskInfo; + transcodeWebTask?: TaskInfo; + transcodeMobileTask?: TaskInfo; + transcribeTask?: TaskInfo; uploadProgress: number; errorMessage?: string; isCancelling?: boolean; tokenSource?: CancelTokenSource; transcript?: string; - media?: Media[]; + originalMedia?: Media; + webMedia?: Media; + mobileMedia?: Media; + vttMedia?: Media; } export interface MentorExportJson { @@ -163,9 +176,24 @@ export function convertAnswerGQL(gql: AnswerGQL): Answer { ...gql, question: gql?.question?._id, questionClientId: gql?.question?.clientId, + media: getAnswerGQLMediaList(gql), }; } +export function getAnswerGQLMediaList(answerGql: AnswerGQL): Media[] { + const mediaList = []; + if (answerGql.webMedia) { + mediaList.push(answerGql.webMedia); + } + if (answerGql.mobileMedia) { + mediaList.push(answerGql.mobileMedia); + } + if (answerGql.vttMedia) { + mediaList.push(answerGql.vttMedia); + } + return mediaList; +} + export function convertUserQuestionGQL(gql: UserQuestionGQL): UserQuestion { return { ...gql, @@ -179,6 +207,8 @@ export function convertUploadTaskGQL(gql: UploadTaskGQL): UploadTask { return { ...gql, question: gql.question._id, + taskList: getTaskListFromUploadTask(gql), + media: getMediaListFromUploadTask(gql), }; } @@ -194,3 +224,41 @@ export function convertConnectionGQL( })), }; } + +export function getTaskListFromUploadTask( + uploadTaskGql: UploadTaskGQL +): TaskInfo[] { + const taskList = []; + if (uploadTaskGql.trimUploadTask) { + taskList.push(uploadTaskGql.trimUploadTask); + } + if (uploadTaskGql.transcodeMobileTask) { + taskList.push(uploadTaskGql.transcodeMobileTask); + } + if (uploadTaskGql.transcodeWebTask) { + taskList.push(uploadTaskGql.transcodeWebTask); + } + if (uploadTaskGql.transcribeTask) { + taskList.push(uploadTaskGql.transcribeTask); + } + return taskList; +} + +export function getMediaListFromUploadTask( + uploadTaskGql: UploadTaskGQL +): Media[] { + const mediaList = []; + if (uploadTaskGql.webMedia) { + mediaList.push(uploadTaskGql.webMedia); + } + if (uploadTaskGql.mobileMedia) { + mediaList.push(uploadTaskGql.mobileMedia); + } + if (uploadTaskGql.vttMedia) { + mediaList.push(uploadTaskGql.vttMedia); + } + if (uploadTaskGql.originalMedia) { + mediaList.push(uploadTaskGql.originalMedia); + } + return mediaList; +} diff --git a/client/src/types.ts b/client/src/types.ts index d84bce38..2c9b8944 100644 --- a/client/src/types.ts +++ b/client/src/types.ts @@ -250,7 +250,6 @@ export enum UploadTaskStatuses { export interface TaskInfo { task_name: string; - task_id: string; status: UploadTaskStatuses; } diff --git a/cypress/cypress/integration/filemanager.spec.ts b/cypress/cypress/integration/filemanager.spec.ts index a696e230..cadc578d 100644 --- a/cypress/cypress/integration/filemanager.spec.ts +++ b/cypress/cypress/integration/filemanager.spec.ts @@ -129,22 +129,16 @@ describe("file manager page", () => { _id: "A1_1_1", question: "Tell me about yourself", }, - - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - ], + trimUploadTask: { + task_name: "trim_upload", + status: "IN_PROGRESS", + }, transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + webMedia: { + type: "video", + tag: "web", + url: "http://google.mp4", + }, }, ], }, diff --git a/cypress/cypress/integration/index.spec.ts b/cypress/cypress/integration/index.spec.ts index 12e2ada6..f0b54f82 100644 --- a/cypress/cypress/integration/index.spec.ts +++ b/cypress/cypress/integration/index.spec.ts @@ -8,36 +8,63 @@ import { cyMockDefault, mockGQL } from "../support/functions"; import newMentor from "../fixtures/mentor/clint_new"; import clint from "../fixtures/mentor/clint_home"; import { login as loginDefault } from "../fixtures/login"; -import { UserRole } from "../support/types"; +import { TaskInfo, UserRole } from "../support/types"; -function taskListBuild(progressForAllTasks) { - return [ - { +export function taskListBuild(progressForAllTasks) { + return { + trimUploadTask: { task_name: "trim_upload", - task_id: "trim_id", status: progressForAllTasks, }, - { - task_name: "transcribe", - task_id: "transcribe_id", + transcodeWebTask: { + task_name: "transcode-web", status: progressForAllTasks, }, - { - task_name: "transcode", - task_id: "transcode_id", + tanscodeMobileTask: { + task_name: "transcode-mobile", status: progressForAllTasks, }, - { - task_name: "finalization", - task_id: "finalization_id", + transcribeTask: { + task_name: "transcribe", status: progressForAllTasks, }, - ]; + }; +} + +export function uploadTaskMediaBuild() { + return { + originalMedia: { + type: "video", + tag: "original", + url: "http://google.mp4/original.mp4", + }, + webMedia: { + type: "video", + tag: "web", + url: "http://google.mp4", + }, + mobileMedia: { + type: "video", + tag: "mobile", + url: "http://google.mp4", + }, + vttMedia: { + type: "vtt", + tag: "en", + url: "http://google.mp4", + }, + }; } describe("Index page", () => { it("if not logged in, show login page", () => { - cyMockDefault(cy, { noAccessTokenStored: true }); + cyMockDefault(cy, { + noAccessTokenStored: true, + gqlQueries: [ + mockGQL("ImportTask", { importTask: null }), + mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), + ], + }); cy.visit("/"); cy.location("pathname").then(($el) => { assert($el.replace("/admin", ""), "/"); @@ -46,7 +73,13 @@ describe("Index page", () => { }); it("if logged in and setup not complete, redirect to setup page", () => { - cyMockDefault(cy, { mentor: newMentor }); + cyMockDefault(cy, { + mentor: newMentor, + gqlQueries: [ + mockGQL("ImportTask", { importTask: null }), + mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), + ], + }); cy.visit("/"); cy.location("pathname").then(($el) => { assert($el.replace("/admin", ""), "/setup"); @@ -54,7 +87,13 @@ describe("Index page", () => { }); it("if logged in and setup complete, show home page", () => { - cyMockDefault(cy, { mentor: clint }); + cyMockDefault(cy, { + mentor: clint, + gqlQueries: [ + mockGQL("ImportTask", { importTask: null }), + mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), + ], + }); cy.visit("/"); cy.location("pathname").then(($el) => { assert($el.replace("/admin", ""), "/"); @@ -69,6 +108,10 @@ describe("Index page", () => { ...loginDefault, user: { ...loginDefault.user, userRole: UserRole.ADMIN }, }, + gqlQueries: [ + mockGQL("ImportTask", { importTask: null }), + mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), + ], }); cy.visit("/"); cy.get("[data-cy=setup-no]").trigger("mouseover").click(); @@ -84,6 +127,10 @@ describe("Index page", () => { ...loginDefault, user: { ...loginDefault.user, userRole: UserRole.CONTENT_MANAGER }, }, + gqlQueries: [ + mockGQL("ImportTask", { importTask: null }), + mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), + ], }); cy.visit("/"); cy.get("[data-cy=setup-no]").trigger("mouseover").click(); @@ -99,6 +146,10 @@ describe("Index page", () => { ...loginDefault, user: { ...loginDefault.user, userRole: UserRole.USER }, }, + gqlQueries: [ + mockGQL("ImportTask", { importTask: null }), + mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), + ], }); cy.visit("/"); cy.get("[data-cy=setup-no]").trigger("mouseover").click(); @@ -121,7 +172,7 @@ describe("Index page", () => { question: clint.answers[0].question.question, }, - taskList: taskListBuild("IN_PROGRESS"), + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", media: [ { @@ -137,7 +188,7 @@ describe("Index page", () => { question: clint.answers[1].question.question, }, - taskList: taskListBuild("IN_PROGRESS"), + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", media: [ { @@ -153,7 +204,7 @@ describe("Index page", () => { question: clint.answers[2].question.question, }, - taskList: taskListBuild("IN_PROGRESS"), + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", media: [ { @@ -167,6 +218,7 @@ describe("Index page", () => { }, }, ]), + mockGQL("ImportTask", { importTask: null }), ], }); cy.visit("/"); @@ -193,7 +245,7 @@ describe("Index page", () => { question: clint.answers[0].question.question, }, - taskList: taskListBuild("IN_PROGRESS"), + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", media: [ { @@ -209,7 +261,7 @@ describe("Index page", () => { question: clint.answers[1].question.question, }, - taskList: taskListBuild("IN_PROGRESS"), + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", media: [ { @@ -225,7 +277,7 @@ describe("Index page", () => { question: clint.answers[2].question.question, }, - taskList: taskListBuild("IN_PROGRESS"), + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", media: [ { @@ -239,6 +291,7 @@ describe("Index page", () => { }, }, ]), + mockGQL("ImportTask", { importTask: null }), ], }); cy.visit("/"); diff --git a/cypress/cypress/integration/record.spec.ts b/cypress/cypress/integration/record.spec.ts index 3da82358..845bfb22 100644 --- a/cypress/cypress/integration/record.spec.ts +++ b/cypress/cypress/integration/record.spec.ts @@ -24,6 +24,7 @@ import { completeSubjectQuestion, updateMentorAnswer, } from "../support/helpers"; +import { taskListBuild, uploadTaskMediaBuild } from "./index.spec"; const chatMentor: Mentor = completeMentor({ _id: "clintanderson", @@ -146,39 +147,33 @@ const videoMentor: Mentor = completeMentor({ _id: "A2_1_1", question: { _id: "A2_1_1", question: "How old are you now?" }, transcript: "I'm 37 years old", - media: [ - { - type: MediaType.VIDEO, - tag: "web", - url: "A2_1_1.mp4", - }, - ], + webMedia: { + type: MediaType.VIDEO, + tag: "web", + url: "A2_1_1.mp4", + }, status: Status.COMPLETE, }, { _id: "A3_1_1", question: { _id: "A3_1_1", question: "Where do you live?" }, transcript: "In Howard City, Michigan", - media: [ - { - type: MediaType.VIDEO, - tag: "web", - url: "A3_1_1.mp4", - }, - ], + webMedia: { + type: MediaType.VIDEO, + tag: "web", + url: "A3_1_1.mp4", + }, status: Status.COMPLETE, }, { _id: "A4_1_1", question: { _id: "A4_1_1", question: "Record an idle video" }, transcript: "", - media: [ - { - type: MediaType.VIDEO, - tag: "web", - url: "A3_1_1.mp4", - }, - ], + webMedia: { + type: MediaType.VIDEO, + tag: "web", + url: "A3_1_1.mp4", + }, status: Status.COMPLETE, }, ], @@ -640,6 +635,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -649,36 +645,24 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), + transcript: "i am kayla", + ...uploadTaskMediaBuild(), + }, + ], + }, + }, + { + me: { + uploadTasks: [ + { + question: { + _id: videoMentor.answers[0].question._id, + question: videoMentor.answers[0].question.question, + }, + ...taskListBuild("IN_PROGRESS"), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -691,36 +675,9 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("DONE"), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -730,13 +687,11 @@ describe("Record", () => { }); cy.visit("/record"); //upload in progress - cy.get("[data-cy=upload-in-progress-notifier]").should("be.visible"); cy.get("[data-cy=upload-video]").should("contain.text", "Processing"); cy.get("[data-cy=upload-video]").should("be.disabled"); cy.get("[data-cy=video-player]").should("not.be.visible"); cy.wait(3000); //upload complete, should swap to video view - cy.get("[data-cy=upload-in-progress-notifier]").should("not.be.visible"); cy.get("[data-cy=upload-video]").should("contain.text", "Upload Video"); cy.get("[data-cy=upload-video]").should("be.disabled"); cy.get("[data-cy=video-player]").should("be.visible"); @@ -751,6 +706,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), ], }); @@ -781,6 +737,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -790,73 +747,16 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("DONE"), + ...uploadTaskMediaBuild(), }, ], }, @@ -880,6 +780,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -890,73 +791,18 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "FAILED", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("FAILED"), + ...uploadTaskMediaBuild(), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], }, { question: { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("DONE"), + ...uploadTaskMediaBuild(), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], }, { question: { @@ -964,36 +810,9 @@ describe("Record", () => { question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("DONE"), + ...uploadTaskMediaBuild(), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], }, ], }, @@ -1020,6 +839,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -1030,36 +850,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], }, { question: { @@ -1067,36 +860,9 @@ describe("Record", () => { question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("DONE"), + ...uploadTaskMediaBuild(), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], }, ], }, @@ -1122,6 +888,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), ], }); @@ -1146,6 +913,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -1155,108 +923,24 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[2].question._id, question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -1269,108 +953,24 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[2].question._id, question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -1406,7 +1006,6 @@ describe("Record", () => { ); }); - //Test that the widget displays mutliple cards with multiple uploads it("displays multiple cards with multiple uploads", () => { cyMockDefault(cy, { mentor: [videoMentor], @@ -1415,6 +1014,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -1424,108 +1024,24 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[2].question._id, question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -1546,7 +1062,9 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), + mockGQL("ImportTask", { importTask: null }), ], }); cy.visit("/record"); @@ -1561,7 +1079,9 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), + mockGQL("ImportTask", { importTask: null }), ], }); cy.visit("/record?videoId=A1_1_1"); @@ -1592,6 +1112,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -1601,36 +1122,8 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -1643,36 +1136,8 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -1692,6 +1157,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -1701,108 +1167,24 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[2].question._id, question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -1815,108 +1197,24 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[2].question._id, question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -1944,6 +1242,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -1953,108 +1252,24 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[2].question._id, question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -2067,108 +1282,24 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[2].question._id, question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -2196,6 +1327,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -2205,36 +1337,8 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -2247,36 +1351,8 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -2289,36 +1365,8 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -2331,36 +1379,8 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -2398,6 +1418,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -2407,37 +1428,8 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, { question: { @@ -2445,73 +1437,16 @@ describe("Record", () => { question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("DONE"), + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[2].question._id, question: videoMentor.answers[2].question.question, }, - - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], - transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("DONE"), + ...uploadTaskMediaBuild(), }, ], }, @@ -2534,6 +1469,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), ], }); @@ -2554,6 +1490,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -2564,36 +1501,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, { question: { @@ -2601,36 +1511,9 @@ describe("Record", () => { question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, { question: { @@ -2638,36 +1521,9 @@ describe("Record", () => { question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -2680,72 +1536,18 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, { question: { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "FAILED", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "FAILED", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "FAILED", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "FAILED", - }, - ], + ...taskListBuild("FAILED"), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, { question: { @@ -2753,36 +1555,9 @@ describe("Record", () => { question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("DONE"), transcript: "i am kayla", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -2827,6 +1602,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), ], }); @@ -2843,6 +1619,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), ], }); @@ -2866,6 +1643,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), ], }); @@ -2904,6 +1682,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", []), ], }); @@ -2925,6 +1704,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", []), ], }); @@ -2945,6 +1725,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -2955,36 +1736,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("DONE"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -3010,6 +1764,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -3020,36 +1775,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, { question: { @@ -3057,36 +1785,9 @@ describe("Record", () => { question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -3108,6 +1809,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -3118,36 +1820,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, { question: { @@ -3155,36 +1830,9 @@ describe("Record", () => { question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -3209,6 +1857,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -3219,36 +1868,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, { question: { @@ -3256,36 +1878,9 @@ describe("Record", () => { question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, { question: { @@ -3293,36 +1888,9 @@ describe("Record", () => { question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -3344,6 +1912,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -3354,36 +1923,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, { question: { @@ -3391,36 +1933,9 @@ describe("Record", () => { question: videoMentor.answers[2].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, { question: { @@ -3428,36 +1943,9 @@ describe("Record", () => { question: videoMentor.answers[3].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -3485,6 +1973,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), ], }); @@ -3528,6 +2017,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [{ me: { uploadTasks: [] } }]), ], }); @@ -3609,6 +2099,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { uploadTasks: [] } }, { @@ -3619,36 +2110,9 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("DONE"), transcript: "My name is Clint Anderson", - media: [ - { - type: "video", - tag: "web", - url: "video.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -3702,6 +2166,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -3712,116 +2177,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], - }, - { - question: { - _id: videoMentor.answers[1].question._id, - question: videoMentor.answers[1].question.question, - }, - - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], - }, - ], - }, - }, - { - me: { - uploadTasks: [ - { - question: { - _id: videoMentor.answers[0].question._id, - question: videoMentor.answers[0].question.question, - }, - - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, { question: { @@ -3829,36 +2187,9 @@ describe("Record", () => { question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -3871,35 +2202,8 @@ describe("Record", () => { _id: videoMentor.answers[0].question._id, question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "FAILED", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "FAILED", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "FAILED", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "FAILED", - }, - ], - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("FAILED"), + ...uploadTaskMediaBuild(), }, { question: { @@ -3907,36 +2211,9 @@ describe("Record", () => { question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "FAILED", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "FAILED", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "FAILED", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "FAILED", - }, - ], + ...taskListBuild("FAILED"), transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -3950,13 +2227,13 @@ describe("Record", () => { cy.get("[data-cy=active-upload-card-0]").within(($within) => { cy.get("[data-cy=card-answer-title]") .get("p") - .should("have.text", "Failed to process file: trim_upload task failed"); + .should("contain.text", "Failed to process file"); }); cy.get("[data-cy=active-upload-card-1]").should("exist"); cy.get("[data-cy=active-upload-card-1]").within(($within) => { cy.get("[data-cy=card-answer-title]") .get("p") - .should("have.text", "Failed to process file: trim_upload task failed"); + .should("contain.text", "Failed to process file"); }); }); @@ -3968,6 +2245,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -3978,36 +2256,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -4021,36 +2272,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("DONE"), transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -4059,13 +2283,14 @@ describe("Record", () => { ], }); cy.visit("/record"); + cy.wait(3000); cy.get("[data-cy=warn-empty-transcript]").should("exist"); cy.get("[data-cy=active-upload-card-0]").within(($within) => { cy.get("p").should("have.text", "Needs Attention"); }); }); - it("download button visible for upload items with original url avaialble", () => { + it("download button visible for upload items with original video", () => { cyMockDefault(cy, { mentor: [videoMentor], questions: videoQuestions, @@ -4073,6 +2298,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -4083,36 +2309,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4/original.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -4134,6 +2333,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -4144,36 +2344,9 @@ describe("Record", () => { question: videoMentor.answers[0].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("DONE"), transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -4195,6 +2368,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -4204,36 +2378,9 @@ describe("Record", () => { _id: videoMentor.answers[3].question._id, question: videoMentor.answers[3].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -4246,36 +2393,9 @@ describe("Record", () => { _id: videoMentor.answers[3].question._id, question: videoMentor.answers[3].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -4297,6 +2417,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", []), ], }); @@ -4318,6 +2439,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", []), ], }); @@ -4335,6 +2457,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", []), ], }); @@ -4357,6 +2480,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", []), ], }); @@ -4378,6 +2502,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", []), ], }); @@ -4396,6 +2521,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -4405,36 +2531,9 @@ describe("Record", () => { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], + ...taskListBuild("IN_PROGRESS"), transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -4447,36 +2546,9 @@ describe("Record", () => { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], + ...taskListBuild("DONE"), transcript: "", - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...uploadTaskMediaBuild(), }, ], }, @@ -4497,6 +2569,7 @@ describe("Record", () => { mockGQL("UploadTaskDelete", { me: { uploadTaskDelete: true } }), mockGQL("UpdateAnswer", { me: { updateAnswer: true } }), mockGQL("UpdateQuestion", { me: { updateQuestion: true } }), + mockGQL("ImportTask", { importTask: null }), mockGQL("FetchUploadTasks", [ { me: { @@ -4506,35 +2579,8 @@ describe("Record", () => { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "IN_PROGRESS", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "IN_PROGRESS", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "IN_PROGRESS", - }, - ], - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("IN_PROGRESS"), + ...uploadTaskMediaBuild(), }, ], }, @@ -4547,35 +2593,8 @@ describe("Record", () => { _id: videoMentor.answers[1].question._id, question: videoMentor.answers[1].question.question, }, - taskList: [ - { - task_name: "trim_upload", - task_id: "trim_id", - status: "DONE", - }, - { - task_name: "transcribe", - task_id: "transcribe_id", - status: "DONE", - }, - { - task_name: "transcode", - task_id: "transcode_id", - status: "DONE", - }, - { - task_name: "finalization", - task_id: "finalization_id", - status: "DONE", - }, - ], - media: [ - { - type: "video", - tag: "web", - url: "http://google.mp4", - }, - ], + ...taskListBuild("DONE"), + ...uploadTaskMediaBuild(), }, ], }, diff --git a/cypress/cypress/support/types.ts b/cypress/cypress/support/types.ts index 2f0f55e5..bf42d7c8 100644 --- a/cypress/cypress/support/types.ts +++ b/cypress/cypress/support/types.ts @@ -219,7 +219,6 @@ export enum UploadTaskStatuses { export interface TaskInfo { task_name: string; - task_id: string; status: UploadTaskStatuses; }