feat: publish av-tools 0.2.0
This commit is contained in:
@@ -283,6 +283,72 @@ describe('AdvancedOperations', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('emits bounded scene analysis settings for series and contact sheets', async () => {
|
||||
const user = userEvent.setup();
|
||||
const onThumbnailSeries = vi.fn();
|
||||
const onContactSheet = vi.fn();
|
||||
render(
|
||||
<AdvancedOperations
|
||||
source={SOURCE}
|
||||
availability={capabilities(
|
||||
'thumbnail-series',
|
||||
'contact-sheet',
|
||||
'scene-change-analysis',
|
||||
'contact-sheet-labels'
|
||||
)}
|
||||
imageFormatAvailability={{ jpeg: AVAILABLE }}
|
||||
onThumbnailSeries={onThumbnailSeries}
|
||||
onContactSheet={onContactSheet}
|
||||
/>
|
||||
);
|
||||
|
||||
await user.click(
|
||||
screen.getByRole('tab', {
|
||||
name: 'Thumbnails and contact sheets',
|
||||
})
|
||||
);
|
||||
const selectionFields = screen.getAllByLabelText('Frame selection');
|
||||
await user.selectOptions(selectionFields[0]!, 'scene-changes');
|
||||
await user.clear(screen.getByLabelText('Scene sensitivity threshold'));
|
||||
await user.type(
|
||||
screen.getByLabelText('Scene sensitivity threshold'),
|
||||
'0.42'
|
||||
);
|
||||
await user.click(
|
||||
screen.getByRole('button', { name: 'Generate thumbnail series' })
|
||||
);
|
||||
await waitFor(() =>
|
||||
expect(onThumbnailSeries).toHaveBeenCalledWith({
|
||||
distribution: {
|
||||
type: 'scene-changes',
|
||||
count: 12,
|
||||
threshold: 0.42,
|
||||
},
|
||||
width: 480,
|
||||
format: 'jpeg',
|
||||
quality: 85,
|
||||
})
|
||||
);
|
||||
|
||||
await user.selectOptions(selectionFields[1]!, 'scene-changes');
|
||||
await user.clear(screen.getByLabelText('Contact-sheet scene threshold'));
|
||||
await user.type(
|
||||
screen.getByLabelText('Contact-sheet scene threshold'),
|
||||
'0.3'
|
||||
);
|
||||
await user.click(
|
||||
screen.getByRole('button', { name: 'Generate contact sheet' })
|
||||
);
|
||||
await waitFor(() =>
|
||||
expect(onContactSheet).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
frameCount: 12,
|
||||
selection: { type: 'scene-changes', threshold: 0.3 },
|
||||
})
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
it('classifies bitmap subtitles conservatively before enabling extraction', async () => {
|
||||
const user = userEvent.setup();
|
||||
const onSubtitleAction = vi.fn();
|
||||
|
||||
Reference in New Issue
Block a user