feat: publish av-tools 0.2.0
This commit is contained in:
@@ -274,6 +274,7 @@ describe('StructuralOperations', () => {
|
||||
presetId: 'video-ready',
|
||||
missingAudioPolicy: 'insert-silence',
|
||||
subtitlePolicy: 'reject',
|
||||
crossfadeSeconds: 0,
|
||||
})
|
||||
);
|
||||
});
|
||||
@@ -328,6 +329,55 @@ describe('StructuralOperations', () => {
|
||||
presetId: 'video-ready',
|
||||
missingAudioPolicy: 'insert-silence',
|
||||
subtitlePolicy: 'drop-all',
|
||||
crossfadeSeconds: 0,
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('emits a bounded crossfade only after its filters are verified', async () => {
|
||||
const user = userEvent.setup();
|
||||
const onConcat = vi.fn();
|
||||
render(
|
||||
<StructuralOperations
|
||||
timeline={{
|
||||
...TIMELINE,
|
||||
clips: TIMELINE.clips.map((clip) => ({
|
||||
...clip,
|
||||
durationSeconds: 3,
|
||||
})),
|
||||
}}
|
||||
exportPresets={PRESETS}
|
||||
availability={capabilities('concat-normalized', 'concat-crossfade')}
|
||||
onConcat={onConcat}
|
||||
/>
|
||||
);
|
||||
|
||||
await user.click(
|
||||
screen.getByRole('radio', { name: /Normalized re-encode/iu })
|
||||
);
|
||||
await user.selectOptions(
|
||||
screen.getByLabelText('Normalized concat preset'),
|
||||
'video-ready'
|
||||
);
|
||||
await user.click(screen.getByRole('radio', { name: /Insert silence/iu }));
|
||||
await user.click(
|
||||
screen.getByRole('radio', { name: /Reject subtitle input/iu })
|
||||
);
|
||||
await user.clear(screen.getByLabelText(/^Crossfade duration/iu));
|
||||
await user.type(screen.getByLabelText(/^Crossfade duration/iu), '0.5');
|
||||
await user.click(
|
||||
screen.getByRole('button', { name: 'Export normalized concat' })
|
||||
);
|
||||
|
||||
await waitFor(() =>
|
||||
expect(onConcat).toHaveBeenCalledWith({
|
||||
operation: 'concat',
|
||||
mode: 'normalized',
|
||||
clipIds: ['clip-a', 'clip-b'],
|
||||
presetId: 'video-ready',
|
||||
missingAudioPolicy: 'insert-silence',
|
||||
subtitlePolicy: 'reject',
|
||||
crossfadeSeconds: 0.5,
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user