diff --git a/api/tests/series/seed-serie.test.ts b/api/tests/series/seed-serie.test.ts index 37614b69..d3a0587e 100644 --- a/api/tests/series/seed-serie.test.ts +++ b/api/tests/series/seed-serie.test.ts @@ -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, + }, + ], + }); }); });