Fix need-rendering test

This commit is contained in:
Zoe Roux 2025-01-28 18:26:12 +01:00
parent 1a2ab48c73
commit cf59695e09
No known key found for this signature in database
2 changed files with 5 additions and 7 deletions

View File

@ -81,10 +81,11 @@ export const insertEntries = async (
const vids = items.flatMap(
(seed, i) =>
seed.videos?.map((x) => ({
seed.videos?.map((x, j) => ({
videoId: x,
entryPk: retEntries[i].pk,
needRendering: seed.videos!.length > 1,
// The first video should not have a rendering.
needRendering: j && seed.videos!.length > 1,
})) ?? [],
);

View File

@ -382,7 +382,6 @@ describe("Movie seeding", () => {
},
]);
expectStatus(vresp, video).toBe(201);
console.log(video);
const [resp, body] = await createMovie({
...bubble,
@ -390,7 +389,6 @@ describe("Movie seeding", () => {
videos: [video[0].id, video[1].id],
});
expectStatus(resp, body).toBe(201);
console.log(body);
const ret = await db.query.shows.findFirst({
where: eq(shows.id, body.id),
@ -401,9 +399,8 @@ describe("Movie seeding", () => {
expect(ret!.entries[0].slug).toBe("bubble-rtest");
expect(ret!.entries[0].evj).toBeArrayOfSize(2);
expect(ret!.entries[0].evj).toContainValues([
{ slug: "bubble-rtest-oeunhtoeuth" },
{ slug: "bubble-rtest-aoeuaoeu" },
{ slug: "bubble-rtest" },
expect.objectContaining({ slug: "bubble-rtest" }),
expect.objectContaining({ slug: "bubble-rtest-aoeuaoeu" }),
]);
});
});