feat: add asset variants endpoint
This commit is contained in:
13
apps/web/src/__tests__/variants-route.test.ts
Normal file
13
apps/web/src/__tests__/variants-route.test.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { test, expect } from "bun:test";
|
||||
|
||||
test("variants route returns only kind/size/key fields", async () => {
|
||||
const { shapeVariants } = await import(
|
||||
"../../app/api/assets/[id]/variants/shape",
|
||||
);
|
||||
const rows = [
|
||||
{ kind: "video_mp4", size: 720, key: "derived/video/a.mp4", mime_type: "video/mp4" },
|
||||
];
|
||||
expect(shapeVariants(rows)).toEqual([
|
||||
{ kind: "video_mp4", size: 720, key: "derived/video/a.mp4" },
|
||||
]);
|
||||
});
|
||||
Reference in New Issue
Block a user