You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
788 B
22 lines
788 B
import { describe, expect, test } from "bun:test";
|
|
import { parseMeMediaAssetsQuery } from "./me-media-assets-query";
|
|
|
|
describe("parseMeMediaAssetsQuery", () => {
|
|
test("defaults: {} -> { page: 1, pageSize: 20 }", () => {
|
|
expect(parseMeMediaAssetsQuery({})).toEqual({ page: 1, pageSize: 20 });
|
|
});
|
|
|
|
test("pageSize 10 and 50 are accepted", () => {
|
|
expect(parseMeMediaAssetsQuery({ pageSize: "10" })).toEqual({ page: 1, pageSize: 10 });
|
|
expect(parseMeMediaAssetsQuery({ pageSize: "50" })).toEqual({ page: 1, pageSize: 50 });
|
|
});
|
|
|
|
test("pageSize 15 throws with statusCode 400", () => {
|
|
try {
|
|
parseMeMediaAssetsQuery({ pageSize: "15" });
|
|
expect.unreachable();
|
|
} catch (e: unknown) {
|
|
expect(e).toMatchObject({ statusCode: 400 });
|
|
}
|
|
});
|
|
});
|
|
|