Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "eslint .",
"test:clip-drafts": "node scripts/smoke-clip-drafts.mjs",
"test:clip-batch-export": "node scripts/smoke-clip-batch-export.mjs",
"test:clip-prepare-export": "node scripts/smoke-clip-prepare-export.mjs",
"test:clip-publishing": "node scripts/smoke-clip-publishing.mjs",
"test:clip-presentation": "node scripts/smoke-clip-presentation.mjs",
"test:home-onboarding": "node scripts/smoke-home-onboarding.mjs",
Expand Down
47 changes: 47 additions & 0 deletions frontend/scripts/smoke-clip-prepare-export.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'node:path';

const __dirname = dirname(fileURLToPath(import.meta.url));
const panelSource = readFileSync(resolve(__dirname, '../src/components/AIPanel.tsx'), 'utf8');

assert.match(panelSource, /const \[advancedExportOpen, setAdvancedExportOpen\] = useState\(false\)/);
assert.match(panelSource, /Advanced export settings/);
assert.match(panelSource, /aria-controls=\{`advanced-export-settings-\$\{draft\.id\}`\}/);
assert.match(panelSource, /advancedExportOpen && \(/);
assert.match(panelSource, /label="Frame"/);
assert.match(panelSource, /label="Captions"/);
assert.match(panelSource, /label="Style"/);
assert.match(panelSource, /label="Resolution"/);
assert.match(panelSource, /label="Format"/);
assert.match(panelSource, /<span>Enhance audio<\/span>/);
assert.match(panelSource, /<ClipBackgroundControls/);

assert.match(panelSource, /const \[publishingCopyOpen, setPublishingCopyOpen\] = useState\(false\)/);
assert.match(panelSource, /Publishing copy — optional/);
assert.match(panelSource, /aria-controls=\{`publishing-copy-\$\{draft\.id\}`\}/);
assert.match(panelSource, /publishingCopyOpen && \(/);
assert.match(panelSource, /publishingCopyOpen && draft\.titleSuggestions/);
assert.match(panelSource, /Publishing copy is ready, but it is not required to export this clip/);
assert.match(panelSource, /onClick=\{onGeneratePublishingCopy\}/);
assert.match(panelSource, /onClick=\{onCopyPublishingCopy\}/);

assert.match(panelSource, /suggested: 'Suggested'/);
assert.match(panelSource, /draft: 'Prepare'/);
assert.match(panelSource, /packaged: 'Prepared'/);
assert.match(panelSource, /exporting: 'Exporting'/);
assert.match(panelSource, /exported: 'Exported'/);
assert.match(panelSource, /failed: 'Needs retry'/);
assert.doesNotMatch(panelSource, /draft: 'Approved'/);
assert.doesNotMatch(panelSource, /packaged: 'Approved'/);

assert.match(panelSource, /const \[clipExportOutputs, setClipExportOutputs\]/);
assert.match(panelSource, /Clip ready/);
assert.match(panelSource, /Video output/);
assert.match(panelSource, /Reveal in Finder/);
assert.match(panelSource, /Download clip/);
assert.match(panelSource, /SRT sidecar/);
assert.match(panelSource, /Download SRT/);
assert.match(panelSource, /const exportWarnings = exportResult\?\.warnings \|\| \[\]/);
assert.match(panelSource, /\$\{successCount\} clip\$\{successCount === 1 \? '' : 's'\} ready/);
Loading