diff --git a/app/src/api.js b/app/src/api.js
index fc80cfe1..6eae64d9 100644
--- a/app/src/api.js
+++ b/app/src/api.js
@@ -264,6 +264,9 @@ export async function transcodeVideo(fileGroupId, {video_codec = null, audio_cod
export async function getJobs() {
const response = await apiGet(`${API_URI}/jobs`);
+ if (!response.ok) {
+ throw new Error(await getErrorMessage(response, 'Unable to get the jobs'));
+ }
const data = await response.json();
return data['jobs'];
}
diff --git a/app/src/components/ThemeSamplePage.js b/app/src/components/ThemeSamplePage.js
index 824f9e7e..4b2f9982 100644
--- a/app/src/components/ThemeSamplePage.js
+++ b/app/src/components/ThemeSamplePage.js
@@ -385,10 +385,7 @@ export function ThemeSamplePage() {
- {/* The video page's Edit button: one labelled button opens a menu of the
- rarer actions, so the row stays short. The trailing chevron is what
- says "menu" rather than "does the thing"; a disabled item stays listed
- so the user learns it exists. */}
+ {/* Mirrors the video page's Edit control. */}
diff --git a/app/src/components/VideoEditMenu.js b/app/src/components/VideoEditMenu.js
index b84ed5fa..23812cfd 100644
--- a/app/src/components/VideoEditMenu.js
+++ b/app/src/components/VideoEditMenu.js
@@ -1,7 +1,9 @@
import React, {useEffect, useRef, useState} from 'react';
import {cancelJob, fetchVideoDownloadDefaults, getJob, transcodeVideo, updateVideo} from '../api';
import {useWROLMode} from '../hooks/customHooks';
-import {Button, Confirm, Group, Icon, Menu, Modal, Progress, Select, Stack, Status, Text, Textarea, TextInput, toast} from './ui';
+import {
+ Button, Confirm, Group, Icon, Menu, Modal, Progress, Select, Stack, Status, Text, Textarea, TextInput, toast,
+} from './ui';
import {
TRANSCODE_COPY,
transcodeAudioCodecOptions,
@@ -9,12 +11,13 @@ import {
transcodeVideoCodecOptions,
} from './Vars';
-// How often the modal asks the API about the running Job.
const JOB_POLL_MS = 2000;
-const FINISHED_STATUSES = ['complete', 'failed', 'cancelled'];
-// Embedded thumbnails are "video" streams to ffprobe, but not codecs a user chooses.
+export const FINISHED_STATUSES = ['complete', 'failed', 'cancelled'];
+// ffprobe calls an embedded thumbnail a video stream.
const THUMBNAIL_CODECS = ['mjpeg', 'png', 'bmp', 'gif'];
+export const isJobFinished = (job) => !!job && FINISHED_STATUSES.includes(job.status);
+
/** The codec names of a Video's real streams, from the `codec_names`/`codec_types` the API sends. */
export function currentCodecs(video) {
const names = video?.codec_names || [];
@@ -38,6 +41,12 @@ export function preferredTarget(preferences, options) {
return TRANSCODE_COPY;
}
+/** The container of a video file, when it is one ffmpeg can write for us. */
+export function currentContainer(video) {
+ const suffix = String(video?.video_path || '').split('.').pop().toLowerCase();
+ return transcodeContainerOptions.some(i => i.value === suffix) ? suffix : null;
+}
+
const statusKind = (status) => {
if (status === 'complete') return 'complete';
if (status === 'running') return 'active';
@@ -45,51 +54,68 @@ const statusKind = (status) => {
return 'pending';
}
-/** Progress, status and log tail of one Job, polled until it finishes. */
-export function JobProgress({jobId, onFinished}) {
+/**
+ * Poll a Job until it finishes. Lives in whichever component must outlive the UI showing the Job:
+ * the page must learn the Job finished even when the user closed the modal that started it.
+ *
+ * A failed request is retried on the next tick; only unmount, a new `jobId`, or a finished status
+ * stops the polling. `onFinished` is called once per Job.
+ */
+export function useJob(jobId, onFinished) {
const [job, setJob] = useState(null);
- const [cancelling, setCancelling] = useState(false);
- const timer = useRef(null);
- const finishedRef = useRef(false);
+ const onFinishedRef = useRef(onFinished);
+ onFinishedRef.current = onFinished;
useEffect(() => {
- finishedRef.current = false;
- let cancelled = false;
+ setJob(null);
+ if (!jobId) {
+ return;
+ }
+ let stopped = false;
+ let timer = null;
const poll = async () => {
- let latest;
+ let latest = null;
try {
latest = await getJob(jobId);
} catch (e) {
console.error(e);
- return;
}
- if (cancelled) return;
- setJob(latest);
- if (FINISHED_STATUSES.includes(latest.status)) {
- if (!finishedRef.current) {
- finishedRef.current = true;
- if (onFinished) onFinished(latest);
+ if (stopped) return;
+ if (latest) {
+ setJob(latest);
+ if (isJobFinished(latest)) {
+ if (onFinishedRef.current) onFinishedRef.current(latest);
+ return;
}
- return;
}
- timer.current = window.setTimeout(poll, JOB_POLL_MS);
+ timer = window.setTimeout(poll, JOB_POLL_MS);
};
poll();
return () => {
- cancelled = true;
- clearTimeout(timer.current);
+ stopped = true;
+ clearTimeout(timer);
};
- // Only a new Job restarts polling; `onFinished` may be a fresh closure on every render.
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [jobId]);
+ const cancel = async () => {
+ const latest = await cancelJob(jobId);
+ setJob(latest);
+ return latest;
+ };
+
+ return {job, cancel};
+}
+
+/** Progress, status and log tail of one Job. */
+export function JobProgress({job, onCancel}) {
+ const [cancelling, setCancelling] = useState(false);
+
const handleCancel = async () => {
setCancelling(true);
try {
- const latest = await cancelJob(jobId);
- setJob(latest);
+ await onCancel();
} catch (e) {
console.error(e);
} finally {
@@ -101,14 +127,14 @@ export function JobProgress({jobId, onFinished}) {
return ;
}
- const finished = FINISHED_STATUSES.includes(job.status);
+ const finished = isJobFinished(job);
const percent = job.progress ?? 0;
const logTail = (job.log || []).slice(-8);
return
{job.status}
- {!finished && i.value === suffix) ? suffix : null;
-}
-
-export function TranscodeModal({open, onClose, fileGroupId, video, onComplete}) {
+export function TranscodeModal({open, onClose, fileGroupId, video, job, jobId, onQueued, onCancelJob}) {
const wrolModeEnabled = useWROLMode();
const [videoCodec, setVideoCodec] = useState(TRANSCODE_COPY);
const [audioCodec, setAudioCodec] = useState(TRANSCODE_COPY);
const [container, setContainer] = useState('mp4');
const [defaultsLoaded, setDefaultsLoaded] = useState(false);
const [submitting, setSubmitting] = useState(false);
- const [jobId, setJobId] = useState(null);
const current = currentCodecs(video);
@@ -169,10 +189,7 @@ export function TranscodeModal({open, onClose, fileGroupId, video, onComplete})
if (!open) {
return;
}
- // Each opening starts over: a finished Job's progress must not linger on the next open.
- setJobId(null);
setDefaultsLoaded(false);
- // Start from the file's own container so a codec-only change keeps it.
setContainer(currentContainer(video) || 'mp4');
let stale = false;
const load = async () => {
@@ -193,7 +210,6 @@ export function TranscodeModal({open, onClose, fileGroupId, video, onComplete})
};
}, [open]);
- // Both streams kept: a remux. Cheap, and it fixes the container (or adds fast start).
const remuxOnly = videoCodec === TRANSCODE_COPY && audioCodec === TRANSCODE_COPY;
const sameContainer = container === currentContainer(video);
@@ -205,7 +221,7 @@ export function TranscodeModal({open, onClose, fileGroupId, video, onComplete})
audio_codec: audioCodec === TRANSCODE_COPY ? null : audioCodec,
container,
});
- setJobId(id);
+ onQueued(id);
} catch (e) {
// transcodeVideo already toasted.
console.error(e);
@@ -214,14 +230,9 @@ export function TranscodeModal({open, onClose, fileGroupId, video, onComplete})
}
};
- const handleFinished = (job) => {
- if (job.status === 'complete') {
- toast({type: 'success', title: 'Transcode complete', description: job.description, time: 5000});
- if (onComplete) onComplete(job);
- }
- };
-
const describe = (codecs) => codecs.length ? codecs.join(', ') : 'unknown';
+ // A queued or finished Job replaces the form until the parent forgets it.
+ const showJob = !!jobId;
return
Transcode Video
@@ -232,7 +243,7 @@ export function TranscodeModal({open, onClose, fileGroupId, video, onComplete})
Streams set to Keep are copied without re-encoding. Transcoding is slow and slightly
reduces quality; the original file is replaced when it finishes.
- {!jobId && <>
+ {!showJob && <>
}
>}
- {jobId && }
+ {showJob && }
- {jobId ? 'Close' : 'Cancel'}
- {!jobId && {showJob ? 'Close' : 'Cancel'}
+ {!showJob && {
+ if (finished.status === 'complete') {
+ toast({type: 'success', title: 'Transcode complete', description: finished.description, time: 5000});
+ if (onTranscodeComplete) onTranscodeComplete(finished);
+ }
+ if (!transcodeOpen) {
+ // Nobody is looking at the result; make room for the next transcode.
+ setJobId(null);
+ }
+ };
+ const {job, cancel} = useJob(jobId, handleJobFinished);
+
+ // Another video: its transcodes are its own.
+ const firstVideoId = useRef(videoFile?.id);
+ useEffect(() => {
+ if (videoFile?.id !== firstVideoId.current) {
+ firstVideoId.current = videoFile?.id;
+ setJobId(null);
+ }
+ }, [videoFile?.id]);
+
+ const handleTranscodeClose = () => {
+ setTranscodeOpen(false);
+ if (isJobFinished(job)) {
+ setJobId(null);
+ }
+ };
const handleDelete = async () => {
setDeleting(true);
@@ -401,6 +444,7 @@ export function VideoEditMenu({videoFile, video, description, onRefresh, onTrans
};
const isVideo = !!videoFile?.mimetype?.startsWith('video/');
+ const transcoding = !!jobId && !isJobFinished(job);
return <>
@@ -425,21 +469,31 @@ export function VideoEditMenu({videoFile, video, description, onRefresh, onTrans
}
onClick={() => setTranscodeOpen(true)}
- disabled={!isVideo || !!wrolModeEnabled}
+ disabled={!isVideo || (!!wrolModeEnabled && !transcoding)}
>
- Transcode...
+ {transcoding ? 'Transcoding...' : 'Transcode...'}
}
onClick={() => setDeleteOpen(true)}
- disabled={!onDelete || !!wrolModeEnabled}
+ disabled={!onDelete || !!wrolModeEnabled || transcoding}
>
Delete...
+
setEditOpen(false)}
@@ -460,12 +514,5 @@ export function VideoEditMenu({videoFile, video, description, onRefresh, onTrans
Are you sure you want to delete this video? All files related to this video will be deleted.
It will not be downloaded again!
- setTranscodeOpen(false)}
- fileGroupId={videoFile?.id}
- video={video}
- onComplete={onTranscodeComplete}
- />
>
}
diff --git a/app/src/components/VideoEditMenu.test.js b/app/src/components/VideoEditMenu.test.js
index a7444189..9bcd6c0e 100644
--- a/app/src/components/VideoEditMenu.test.js
+++ b/app/src/components/VideoEditMenu.test.js
@@ -2,7 +2,8 @@ import React from 'react';
import {act, fireEvent, screen, waitFor} from '@testing-library/react';
import {renderWithProviders} from '../test-utils';
import {
- currentCodecs, currentContainer, EditVideoModal, JobProgress, preferredTarget, TranscodeModal, VideoEditMenu,
+ currentCodecs, currentContainer, EditVideoModal, JobProgress, preferredTarget, TranscodeModal, useJob,
+ VideoEditMenu,
} from './VideoEditMenu';
import {TRANSCODE_COPY, transcodeAudioCodecOptions, transcodeVideoCodecOptions} from './Vars';
@@ -34,6 +35,8 @@ const pendingJob = {
id: 'transcode_video-abc', status: 'pending', progress: null, log: [], error: null, cancel_requested: false,
description: 'Transcode movie.webm',
};
+const runningJob = {...pendingJob, status: 'running', progress: 40, log: ['out_time_us=1']};
+const completeJob = {...pendingJob, status: 'complete', progress: 100, log: ['done']};
describe('helpers', () => {
test('currentCodecs ignores embedded thumbnail streams', () => {
@@ -62,11 +65,13 @@ describe('TranscodeModal', () => {
jest.clearAllMocks();
fetchVideoDownloadDefaults.mockResolvedValue({video_codecs: ['h264'], audio_codecs: ['vorbis', 'aac']});
transcodeVideo.mockResolvedValue('transcode_video-abc');
- getJob.mockResolvedValue(pendingJob);
});
test('pre-populates from the preferred codecs and queues the Job', async () => {
- renderWithProviders();
+ const onQueued = jest.fn();
+ renderWithProviders(
+ ,
+ );
expect(screen.getByText(/Current codecs: video vp9, audio opus/)).toBeInTheDocument();
@@ -80,16 +85,26 @@ describe('TranscodeModal', () => {
await waitFor(() => expect(transcodeVideo).toHaveBeenCalledWith(7, {
video_codec: 'h264', audio_codec: 'aac', container: 'mp4',
}));
- // The form is replaced by the Job's progress.
- await waitFor(() => expect(getJob).toHaveBeenCalledWith('transcode_video-abc'));
+ await waitFor(() => expect(onQueued).toHaveBeenCalledWith('transcode_video-abc'));
+ });
+
+ test('shows the Job instead of the form once one is queued', () => {
+ renderWithProviders(
+ ,
+ );
expect(screen.queryAllByLabelText('Video codec')).toHaveLength(0);
- expect(await screen.findByText('pending')).toBeInTheDocument();
+ expect(screen.getByText('running')).toBeInTheDocument();
+ expect(screen.getByRole('button', {name: 'Close'})).toBeInTheDocument();
+ expect(screen.queryByRole('button', {name: /Transcode/})).not.toBeInTheDocument();
});
test('keeping every stream is a remux into the chosen container', async () => {
fetchVideoDownloadDefaults.mockResolvedValue({video_codecs: [], audio_codecs: []});
// A webm cannot be kept (not a container we write), so the select starts at mp4: a change.
- renderWithProviders();
+ renderWithProviders(
+ ,
+ );
await waitFor(() => expect(selectInput('Container')).toHaveValue('mp4'));
expect(await screen.findByText(/only the container changes to mp4/)).toBeInTheDocument();
@@ -190,7 +205,23 @@ describe('EditVideoModal', () => {
});
});
-describe('JobProgress', () => {
+// A tiny harness so the hook can be driven like the menu drives it.
+function JobHarness({jobId, onFinished}) {
+ const {job, cancel} = useJob(jobId, onFinished);
+ return ;
+}
+
+// Let pending promise callbacks run (a settled request schedules its next poll), then advance
+// the fake clock past the poll interval.
+const nextPoll = async () => {
+ await act(async () => {
+ await Promise.resolve();
+ await Promise.resolve();
+ jest.advanceTimersByTime(2000);
+ });
+};
+
+describe('useJob + JobProgress', () => {
beforeEach(() => {
jest.clearAllMocks();
jest.useFakeTimers();
@@ -202,11 +233,9 @@ describe('JobProgress', () => {
test('polls until the Job finishes, then reports once', async () => {
const onFinished = jest.fn();
- getJob
- .mockResolvedValueOnce({...pendingJob, status: 'running', progress: 40, log: ['out_time_us=1']})
- .mockResolvedValueOnce({...pendingJob, status: 'complete', progress: 100, log: ['done']});
+ getJob.mockResolvedValueOnce(runningJob).mockResolvedValueOnce(completeJob);
- renderWithProviders();
+ renderWithProviders();
await waitFor(() => expect(screen.getByText('running')).toBeInTheDocument());
expect(screen.getByRole('progressbar')).toHaveAttribute('aria-valuenow', '40');
@@ -225,11 +254,36 @@ describe('JobProgress', () => {
expect(screen.queryByRole('button', {name: 'Cancel'})).not.toBeInTheDocument();
});
+ test('a failed request is retried instead of ending the polling', async () => {
+ getJob
+ .mockRejectedValueOnce(new Error('network'))
+ .mockResolvedValueOnce(runningJob)
+ .mockRejectedValueOnce(new Error('network'))
+ .mockResolvedValueOnce(completeJob);
+ const onFinished = jest.fn();
+
+ renderWithProviders();
+
+ // First poll failed: still "Starting...", but another poll is scheduled.
+ await waitFor(() => expect(getJob).toHaveBeenCalledTimes(1));
+ expect(screen.getByText('Starting...')).toBeInTheDocument();
+ await nextPoll();
+ await waitFor(() => expect(screen.getByText('running')).toBeInTheDocument());
+
+ // A failure mid-way keeps the last good state and keeps polling.
+ await nextPoll();
+ await waitFor(() => expect(getJob).toHaveBeenCalledTimes(3));
+ expect(screen.getByText('running')).toBeInTheDocument();
+ await nextPoll();
+ await waitFor(() => expect(screen.getByText('complete')).toBeInTheDocument());
+ expect(onFinished).toHaveBeenCalledTimes(1);
+ });
+
test('Cancel asks the API to cancel the Job', async () => {
getJob.mockResolvedValue({...pendingJob, status: 'running', progress: 10});
cancelJob.mockResolvedValue({...pendingJob, status: 'running', progress: 10, cancel_requested: true});
- renderWithProviders( );
+ renderWithProviders( );
await waitFor(() => expect(screen.getByRole('button', {name: 'Cancel'})).toBeInTheDocument());
fireEvent.click(screen.getByRole('button', {name: 'Cancel'}));
@@ -241,7 +295,7 @@ describe('JobProgress', () => {
test('shows the error of a failed Job', async () => {
getJob.mockResolvedValue({...pendingJob, status: 'failed', error: 'ffmpeg exited with 1', log: ['boom']});
- renderWithProviders( );
+ renderWithProviders( );
await waitFor(() => expect(screen.getByText('failed')).toBeInTheDocument());
expect(screen.getByText('ffmpeg exited with 1')).toBeInTheDocument();
@@ -251,22 +305,46 @@ describe('JobProgress', () => {
describe('VideoEditMenu', () => {
beforeEach(() => {
jest.clearAllMocks();
- fetchVideoDownloadDefaults.mockResolvedValue({video_codecs: [], audio_codecs: []});
+ fetchVideoDownloadDefaults.mockResolvedValue({video_codecs: ['h264'], audio_codecs: ['aac']});
+ transcodeVideo.mockResolvedValue('transcode_video-abc');
});
+ // Mantine's Menu in jsdom: after a modal has closed, the first click on the target can land
+ // while the dropdown still counts as open (and so toggles it shut). Click until items show.
+ const openMenu = async () => {
+ for (let attempt = 0; attempt < 3; attempt++) {
+ fireEvent.click(screen.getByRole('button', {name: /Edit/}));
+ try {
+ return await screen.findByRole('menuitem', {name: /Refresh/}, {timeout: 300});
+ } catch (e) {
+ // Toggled shut; try again.
+ }
+ }
+ throw new Error('The Edit menu did not open');
+ };
+ const openMenuItem = async (name) => {
+ await openMenu();
+ fireEvent.click(screen.getByRole('menuitem', {name}));
+ };
+
test('Refresh calls onRefresh; Transcode opens the modal', async () => {
const onRefresh = jest.fn().mockResolvedValue(undefined);
renderWithProviders();
- fireEvent.click(screen.getByRole('button', {name: /Edit/}));
- fireEvent.click(await screen.findByRole('menuitem', {name: /Refresh/}));
+ await openMenuItem(/Refresh/);
await waitFor(() => expect(onRefresh).toHaveBeenCalledTimes(1));
- fireEvent.click(screen.getByRole('button', {name: /Edit/}));
- fireEvent.click(await screen.findByRole('menuitem', {name: /Transcode/}));
+ await openMenuItem(/Transcode/);
await waitFor(() => expect(screen.getByText('Transcode Video')).toBeInTheDocument());
});
+ test('Edit opens the details modal', async () => {
+ renderWithProviders();
+ await openMenuItem(/^Edit/);
+ expect(await screen.findByText('Edit Video')).toBeInTheDocument();
+ expect(screen.getByLabelText('Title')).toHaveValue('Old Title');
+ });
+
test('Refresh is unavailable without a URL, Transcode for non-video files', async () => {
const audioFile = {...videoFile, url: null, mimetype: 'audio/mpeg'};
renderWithProviders();
@@ -289,22 +367,13 @@ describe('VideoEditMenu', () => {
expect(screen.getByRole('menuitem', {name: /^Edit/})).toBeDisabled();
});
- test('Edit opens the details modal', async () => {
- renderWithProviders();
- fireEvent.click(screen.getByRole('button', {name: /Edit/}));
- fireEvent.click(await screen.findByRole('menuitem', {name: /^Edit/}));
- expect(await screen.findByText('Edit Video')).toBeInTheDocument();
- expect(screen.getByLabelText('Title')).toHaveValue('Old Title');
- });
-
test('Delete asks for confirmation before calling onDelete', async () => {
const onDelete = jest.fn().mockResolvedValue(undefined);
renderWithProviders(
,
);
- fireEvent.click(screen.getByRole('button', {name: /Edit/}));
- fireEvent.click(await screen.findByRole('menuitem', {name: /Delete/}));
+ await openMenuItem(/Delete/);
expect(await screen.findByText('Delete video?')).toBeInTheDocument();
expect(onDelete).not.toHaveBeenCalled();
@@ -318,12 +387,72 @@ describe('VideoEditMenu', () => {
,
);
- fireEvent.click(screen.getByRole('button', {name: /Edit/}));
- fireEvent.click(await screen.findByRole('menuitem', {name: /Delete/}));
+ await openMenuItem(/Delete/);
expect(await screen.findByText('Delete video?')).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', {name: 'Cancel'}));
await waitFor(() => expect(screen.queryByText('Delete video?')).not.toBeInTheDocument());
expect(onDelete).not.toHaveBeenCalled();
});
+
+ test('closing the modal keeps watching the Job and reports completion to the page', async () => {
+ jest.useFakeTimers();
+ try {
+ getJob.mockResolvedValueOnce(runningJob).mockResolvedValueOnce(completeJob);
+ const onTranscodeComplete = jest.fn();
+ renderWithProviders(
+ ,
+ );
+
+ await openMenuItem(/Transcode/);
+ await waitFor(() => expect(selectInput('Video codec')).toHaveValue('h264 (avc1)'));
+ fireEvent.click(screen.getByRole('button', {name: 'Transcode'}));
+ await waitFor(() => expect(screen.getByText('running')).toBeInTheDocument());
+
+ // Close while it runs. The modal is gone but the Job is still watched.
+ fireEvent.click(screen.getByRole('button', {name: 'Close'}));
+ await waitFor(() => expect(screen.queryByText('Transcode Video')).not.toBeInTheDocument());
+
+ await nextPoll();
+ await waitFor(() => expect(onTranscodeComplete).toHaveBeenCalledTimes(1));
+ expect(onTranscodeComplete.mock.calls[0][0].status).toBe('complete');
+ expect(getJob).toHaveBeenCalledTimes(2);
+ } finally {
+ jest.useRealTimers();
+ }
+ });
+
+ test('while a Job runs, Transcode shows its progress and Delete waits', async () => {
+ getJob.mockResolvedValue(runningJob);
+ renderWithProviders(
+ ,
+ );
+ await waitFor(() => expect(getJob).toHaveBeenCalled());
+
+ await openMenu();
+ expect(screen.getByRole('menuitem', {name: 'Transcoding...'})).toBeEnabled();
+ expect(screen.getByRole('menuitem', {name: /Delete/})).toBeDisabled();
+
+ fireEvent.click(screen.getByRole('menuitem', {name: 'Transcoding...'}));
+ expect(await screen.findByText('running')).toBeInTheDocument();
+ expect(screen.queryAllByLabelText('Video codec')).toHaveLength(0);
+ expect(transcodeVideo).not.toHaveBeenCalled();
+ });
+
+ test('a Job that finished unwatched is forgotten, so the next open offers the form', async () => {
+ getJob.mockResolvedValue(completeJob);
+ renderWithProviders(
+ ,
+ );
+ await waitFor(() => expect(getJob).toHaveBeenCalled());
+
+ await openMenu();
+ expect(await screen.findByRole('menuitem', {name: 'Transcode...'})).toBeEnabled();
+ expect(screen.getByRole('menuitem', {name: /Delete/})).toBeEnabled();
+ fireEvent.click(screen.getByRole('menuitem', {name: 'Transcode...'}));
+ await waitFor(() => expect(selectInput('Video codec')).toBeInTheDocument());
+ });
});