mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Test entries seeding
This commit is contained in:
parent
4424e9b40a
commit
30bf2d9207
@ -20,7 +20,7 @@ describe("Serie seeding", () => {
|
||||
where: eq(shows.id, body.id),
|
||||
with: {
|
||||
seasons: { orderBy: seasons.seasonNumber },
|
||||
entries: true,
|
||||
entries: { with: { translations: true } },
|
||||
},
|
||||
});
|
||||
|
||||
@ -31,5 +31,58 @@ describe("Serie seeding", () => {
|
||||
expect(ret!.entries).toBeArrayOfSize(
|
||||
madeInAbyss.entries.length + madeInAbyss.extras.length,
|
||||
);
|
||||
|
||||
const ep13 = madeInAbyss.entries.find((x) => x.order === 13)!;
|
||||
expect(ret!.entries.find((x) => x.order === 13)).toMatchObject({
|
||||
...ep13,
|
||||
slug: "made-in-abyss-s1e13",
|
||||
thumbnail: { source: ep13.thumbnail },
|
||||
translations: [
|
||||
{
|
||||
language: "en",
|
||||
...ep13.translations.en,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const { number, ...special } = madeInAbyss.entries.find(
|
||||
(x) => x.kind === "special",
|
||||
)!;
|
||||
expect(ret!.entries.find((x) => x.kind === "special")).toMatchObject({
|
||||
...special,
|
||||
slug: "made-in-abyss-sp3",
|
||||
episodeNumber: number,
|
||||
thumbnail: { source: special.thumbnail },
|
||||
translations: [
|
||||
{
|
||||
language: "en",
|
||||
...special.translations.en,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const movie = madeInAbyss.entries.find((x) => x.kind === "movie")!;
|
||||
expect(ret!.entries.find((x) => x.kind === "movie")).toMatchObject({
|
||||
...movie,
|
||||
thumbnail: { source: movie.thumbnail },
|
||||
translations: [
|
||||
{
|
||||
language: "en",
|
||||
...movie.translations.en,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const { name, video, kind, ...extra } = madeInAbyss.extras[0];
|
||||
expect(ret!.entries.find((x) => x.kind === "extra")).toMatchObject({
|
||||
...extra,
|
||||
extraKind: kind,
|
||||
translations: [
|
||||
{
|
||||
language: "extra",
|
||||
name,
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user