Skip to content

Commit 7974b81

Browse files
committed
test: cover audio enhancement duration boundaries
1 parent 1b5af24 commit 7974b81

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

apps/web/__tests__/unit/audio-level-publication.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,25 @@ describe("audio derivative publication", () => {
182182
).resolves.toBeUndefined();
183183
expect(writes).toHaveLength(0);
184184
});
185+
it.each([899.999, 900])(
186+
"enhances eligible recordings lasting %s seconds",
187+
async (duration) => {
188+
current.duration = duration;
189+
await enhanceRecordingAudio("video", "owner");
190+
expect(mocks.fetch).toHaveBeenCalledTimes(1);
191+
expect(writes).toHaveLength(1);
192+
},
193+
);
194+
it.each([900.001, 901, 1800])(
195+
"skips recordings lasting %s seconds before accessing storage",
196+
async (duration) => {
197+
current.duration = duration;
198+
await enhanceRecordingAudio("video", "owner");
199+
expect(mocks.access).not.toHaveBeenCalled();
200+
expect(mocks.fetch).not.toHaveBeenCalled();
201+
expect(writes).toHaveLength(0);
202+
},
203+
);
185204
it("does not enhance unverified, legacy or already enhanced recordings", async () => {
186205
jobState = "processing";
187206
await enhanceRecordingAudio("video", "owner");

0 commit comments

Comments
 (0)