mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Fix need-rendering test
This commit is contained in:
parent
1a2ab48c73
commit
cf59695e09
@ -81,10 +81,11 @@ export const insertEntries = async (
|
|||||||
|
|
||||||
const vids = items.flatMap(
|
const vids = items.flatMap(
|
||||||
(seed, i) =>
|
(seed, i) =>
|
||||||
seed.videos?.map((x) => ({
|
seed.videos?.map((x, j) => ({
|
||||||
videoId: x,
|
videoId: x,
|
||||||
entryPk: retEntries[i].pk,
|
entryPk: retEntries[i].pk,
|
||||||
needRendering: seed.videos!.length > 1,
|
// The first video should not have a rendering.
|
||||||
|
needRendering: j && seed.videos!.length > 1,
|
||||||
})) ?? [],
|
})) ?? [],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -382,7 +382,6 @@ describe("Movie seeding", () => {
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
expectStatus(vresp, video).toBe(201);
|
expectStatus(vresp, video).toBe(201);
|
||||||
console.log(video);
|
|
||||||
|
|
||||||
const [resp, body] = await createMovie({
|
const [resp, body] = await createMovie({
|
||||||
...bubble,
|
...bubble,
|
||||||
@ -390,7 +389,6 @@ describe("Movie seeding", () => {
|
|||||||
videos: [video[0].id, video[1].id],
|
videos: [video[0].id, video[1].id],
|
||||||
});
|
});
|
||||||
expectStatus(resp, body).toBe(201);
|
expectStatus(resp, body).toBe(201);
|
||||||
console.log(body);
|
|
||||||
|
|
||||||
const ret = await db.query.shows.findFirst({
|
const ret = await db.query.shows.findFirst({
|
||||||
where: eq(shows.id, body.id),
|
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].slug).toBe("bubble-rtest");
|
||||||
expect(ret!.entries[0].evj).toBeArrayOfSize(2);
|
expect(ret!.entries[0].evj).toBeArrayOfSize(2);
|
||||||
expect(ret!.entries[0].evj).toContainValues([
|
expect(ret!.entries[0].evj).toContainValues([
|
||||||
{ slug: "bubble-rtest-oeunhtoeuth" },
|
expect.objectContaining({ slug: "bubble-rtest" }),
|
||||||
{ slug: "bubble-rtest-aoeuaoeu" },
|
expect.objectContaining({ slug: "bubble-rtest-aoeuaoeu" }),
|
||||||
{ slug: "bubble-rtest" },
|
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user