Skip to content

Show it a video you love. Get a new video in the same style. An AI crew (Claude Code or Codex) plans, builds and reviews it with you.

Merge pull request #63 from yousseflee87/test/round-limits

Eden298df9781dd3
diff --cc app/server/jobs.test.ts
index 5501948,fe724df..5c6a9e3
--- a/app/server/jobs.test.ts
+++ b/app/server/jobs.test.ts
@@@ -27,17 -27,15 +27,24 @@@ describe('cleanRounds', () =>
assert.throws(() => J.cleanRounds({ castRounds: 11 }), /1 to 10/);
assert.throws(() => J.cleanRounds({ chunkRounds: 2.5 }), /whole number/);
});
+ test('the edges of the range pass', () => {
+ assert.deepEqual(J.cleanRounds({ castRounds: 1, finalRounds: 10 }), { castRounds: 1, finalRounds: 10 });
+ assert.deepEqual(J.cleanRounds({ chunkRounds: '10' }), { chunkRounds: 10 });
+ });
+ test('non-numeric input is rejected like the rest', () => {
+ assert.throws(() => J.cleanRounds({ castRounds: 'abc' }), /whole number/);
+ });
});
+describe('isVideoName', () => {
+ test('accepts the video extensions in any letter case', () => {
+ for (const name of ['clip.mp4', 'CLIP.MOV', 'a.b.MkV', '參考影片.webm', 'x.avi', 'x.m4v', 'x.mpg', 'x.mpeg']) assert.ok(J.isVideoName(name), name);
+ });
+ test('rejects subtitles, documents, images and names with no extension', () => {
+ for (const name of ['subs.srt', 'brief.pdf', 'poster.png', 'song.mp3', 'clip.mp4.txt', 'reference', '.mp4']) assert.ok(!J.isVideoName(name), name);
+ });
+});
+
describe('projectTitle', () => {
test('uses the title when one is given', () => {
assert.equal(J.projectTitle('My video', 'a brief', 'en'), 'My video');