mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Add basic collection test
This commit is contained in:
parent
4538d9ce98
commit
98c6263036
24
api/tests/collection/seed-collection.test.ts
Normal file
24
api/tests/collection/seed-collection.test.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { beforeAll, describe, expect, it } from "bun:test";
|
||||||
|
import { createMovie } from "tests/helpers";
|
||||||
|
import { expectStatus } from "tests/utils";
|
||||||
|
import { db } from "~/db";
|
||||||
|
import { shows } from "~/db/schema";
|
||||||
|
import { dune } from "~/models/examples/dune-2021";
|
||||||
|
import { duneCollection } from "~/models/examples/dune-collection";
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
await db.delete(shows);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Collection seeding", () => {
|
||||||
|
it("Can create a movie with a collection", async () => {
|
||||||
|
const [resp, body] = await createMovie({
|
||||||
|
...dune,
|
||||||
|
collection: duneCollection,
|
||||||
|
});
|
||||||
|
expectStatus(resp, body).toBe(201);
|
||||||
|
expect(body.id).toBeString();
|
||||||
|
expect(body.slug).toBe("dune");
|
||||||
|
expect(body.collection.slug).toBe("dune-collection");
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user