test: Add test for getEpisodeWithDownloadLink
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
parent
2c1d6a3dca
commit
f30497a76b
|
|
@ -125,3 +125,7 @@ export const nrkRadio = {
|
|||
getSerieData,
|
||||
getEpisode,
|
||||
};
|
||||
|
||||
export const forTestingOnly = {
|
||||
getEpisodeWithDownloadLink,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { assertEquals } from "$std/assert/assert_equals.ts";
|
|||
import { nrkRadio } from "./nrk.ts";
|
||||
import { assertGreaterOrEqual } from "$std/assert/assert_greater_or_equal.ts";
|
||||
import { assertExists } from "https://deno.land/std@0.216.0/assert/assert_exists.ts";
|
||||
import { forTestingOnly } from "./nrk.ts";
|
||||
|
||||
Deno.test("Verify search query `trygd` returns one result: 'Trygdekontoret'", async () => {
|
||||
const result = await nrkRadio.search("trygd");
|
||||
|
|
@ -40,3 +41,11 @@ Deno.test("Verify getting episodeId 'null' for 'trygdekontoret' yields `null`",
|
|||
|
||||
assertEquals(result, null);
|
||||
});
|
||||
|
||||
Deno.test("Verify getting episode, 'l_0bc5e55a-46b5-48a5-85e5-5a46b5d8a562' with download link works`", async () => {
|
||||
const series = await nrkRadio.getSerieData("trygdekontoret");
|
||||
assertExists(series);
|
||||
|
||||
const result = await forTestingOnly.getEpisodeWithDownloadLink(series.episodes[0], "podcast");
|
||||
assertExists(result);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue