feat: publish av-tools 0.2.0
This commit is contained in:
@@ -26,6 +26,41 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe('MediaPreview', () => {
|
||||
it('starts declared local video playback while inspection continues and preserves the element', () => {
|
||||
const probingAsset: ImportedMediaAsset = {
|
||||
id: 'asset-probing-video',
|
||||
file: new File(['video'], 'lecture.mp4', {
|
||||
type: 'application/octet-stream',
|
||||
}),
|
||||
objectUrl: 'blob:probing-video',
|
||||
phase: 'probing',
|
||||
};
|
||||
const { container, rerender } = render(
|
||||
<MediaPreview asset={probingAsset} />
|
||||
);
|
||||
|
||||
const progressiveVideo = requiredElement(container.querySelector('video'));
|
||||
expect(progressiveVideo).toHaveAttribute('src', probingAsset.objectUrl);
|
||||
expect(
|
||||
screen.getByText(
|
||||
'Local source preview · Media inspection continues in the background.'
|
||||
)
|
||||
).toBeVisible();
|
||||
|
||||
rerender(
|
||||
<MediaPreview
|
||||
asset={{
|
||||
...videoAsset(),
|
||||
id: probingAsset.id,
|
||||
file: probingAsset.file,
|
||||
objectUrl: probingAsset.objectUrl,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
expect(container.querySelector('video')).toBe(progressiveVideo);
|
||||
});
|
||||
|
||||
it('offers bounded configurable proxy settings after playback fails', async () => {
|
||||
const user = userEvent.setup();
|
||||
const onCreateProxy = vi.fn();
|
||||
|
||||
Reference in New Issue
Block a user